Change function into dependencyproperty
- by Jaya Willianto
Hi everyone.. I am new to XAML and WPF and I am learning about DependencyProperty and Path. For example, I have a function like this
public byte[] DownloadPicture()
{
WebClient webClient = new WebClient();
byte[] data;
data = webClient.DownloadData("https://graph.facebook.com/4/picture&type=large");
return data;
}
and I have dependencyproperty like this
public static DependencyProperty DownloadPicProperty =
DependencyProperty.Register("DownloadPic", typeof(byte),
typeof(ImageControl), new PropertyMetadata(false));
How can I connect the DependencyProperty with the DownloadPicture function I wrote? Any suggestions? What should I write in the CLR wrapper?