Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Accessing image from Resource File in XAML markup

0.00/5 (No votes)
9 Mar 2011 1  
Accessing image from Resource File in XAML markup
Suppose we have an image in our Resource file named as LeftBaseTriangle.bmp.

In order to access it via XAML, all we need is to add a reference to project properties like below:
XML
xmlns:properties="clr-namespace:Azad.Modules.MyProject.Properties"


and add the following code:

XML
<image source="{Binding Source={x:Static properties:Resources.LeftBaseTriangle}}" />

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here