Using image resource in XAML markup?
Posted
by Jeff Dahmer
on Stack Overflow
See other posts from Stack Overflow
or by Jeff Dahmer
Published on 2010-04-04T17:32:47Z
Indexed on
2010/04/05
10:23 UTC
Read the original article
Hit count: 268
I'm trying to add little icons to my tabs in WPF but having trouble with how to set up the binding.
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<Image Source="{Binding Source=prop:Resources.eye}" />
<Label VerticalAlignment="Center">Header</Label>
</StackPanel>
</TabItem.Header>
The xmlns:prop is set up for the local project's Properties, I am pulling other values from it elsewhere so I know that the namespace works. The markup above compiles fine BUT I don't see the eye image in the tab.
Also, is there any way to set this up into a template? I'm fairly new to XAML/WPF and each tab will have its own image...
© Stack Overflow or respective owner