c# - Binding image StorageFile to XamlCropControl -
i working xamlcropcontrol library here. can't binding image storagefile crop-control. xamlcropcontrol, that:
<xamlcrop:cropcontrol x:name="crop" imagesource="ms-appx:///assets/wrench.jpg" desiredaspectratio="1.0" />
but in case, need bind image picked gallery pass crop-control. bellow, did not work @ all.
public async void imagereceiver(storagefile image) { bitmapimage bitmapimage = new bitmapimage(); filerandomaccessstream stream = (filerandomaccessstream)await image.openasync(fileaccessmode.read); bitmapimage.setsource(stream); imgparam = bitmapimage; } private bitmapimage imgparam; public writeablebitmap imgparam { { return imgparam; } set { imgparam = value; raisepropertychanged("imgparam"); } }
and in xaml file:
<xamlcrop:cropcontrol x:name="cropcontrol" imagesource="{binding imgparam, mode=twoway}" desiredaspectratio="1.0" background="black" width="100" height="100"/>
Comments
Post a Comment