次の方法で共有


WP7 Mango: Image Download With Custom Referer Header

In Mango we have enabled setting the referer header (and many other headers) on HttpWebRequests. One question that popped up a few times: how do I use this with the Image element and data-binding to download my images. Here is a quick sample to demonstrate how you can do this.

1. Step: define a custom attached property on Image that takes the URI to your image.

 

 

2. Step: implement the download piece when the property changes and customize the header as needed.

 

 

3. Step: Now use your brand new property in your app's XAML.

 

Full sample project is attached.

ImageWithCustomReferer.zip

Comments

  • Anonymous
    August 05, 2011
    can we get a list of headers that were opened ? thanks