Reputation: 391
How do I add a URI image to be used as the background for this style? Is it possible?
Using URI like: "/WpfAPP10;component/Interface.png"
<Style x:Key="mega" BasedOn="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" TargetType="Button" >
<Setter Property="Margin" Value="4"/>
</Style>
Upvotes: 0
Views: 342
Reputation: 391
This is what has worked.
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/uif\yellow.png"/>
</Setter.Value>
</Setter>
Upvotes: 1
Reputation: 13679
use as
<Style x:Key="mega" BasedOn="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" TargetType="Button" >
<Setter Property="Margin" Value="4"/>
<Setter Property="Background" Value="/WpfAPP10;component/Interface.png"/>
</Style>
or
<Setter Property="Background" Value="Interface.png"/>
or
<Setter Property="Background" Value="pack://application:,,,/WpfAPP10;component/Interface.png""/>
this will set the desired image to the background
Upvotes: 1