I want to define an Icon for a MenuItem in XAML.
Providing the full path works fine, but all examples shown in the documentation use a
relative file spec
The following code shows the two probablities. The upper sample does not show the icon
(and it does not matter if you use a backslash \ or a normal slash / or you provide it like ../xxx.yyy )
but the second sample with the full path works fine.
{
...
<MenuItem x:Name="MENItemSelBaseDir" Header="_Select Base Directory" Click="MENItemSelBaseDir_Click" >
<MenuItem.Icon>
<Image Source="/images/FolderOpen.png"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem x:Name="MENItemShowVariables" Header="_Show project variables" Click="MENItemShowVariables_Click" >
<MenuItem.Icon>
<Image Source="D:\C#Prog\WPFProjekte\WPF_CFG\images\Parameter.ico"/>
</MenuItem.Icon>
</MenuItem>
...
}
How to use a relative path instead of an absolute path ?
Many thanks for any hint Wolfgang