65.9K
CodeProject is changing. Read more.
Home

Accessing image from Resource File in XAML markup

starIconstarIconstarIcon
emptyStarIcon
starIcon
emptyStarIcon

3.86/5 (7 votes)

Mar 9, 2011

CPOL
viewsIcon

78577

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:
xmlns:properties="clr-namespace:Azad.Modules.MyProject.Properties"
and add the following code:
<image source="{Binding Source={x:Static properties:Resources.LeftBaseTriangle}}" />