Change function into dependencyproperty

Posted by Jaya Willianto on Stack Overflow See other posts from Stack Overflow or by Jaya Willianto
Published on 2011-03-15T21:02:47Z Indexed on 2011/03/16 8:10 UTC
Read the original article Hit count: 199

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about c#

Related posts about xaml