(depending upon the type of application.....).
e.g.
Under Page Tag.
<Page.Resources><SolidColorBrush x:Key="bgcolor" Color="green"/>
<SolidColorBrush x:Key="fgcolor" Color="yellow"/>
</Page.Resources
Under Window Tag.
<Window.Resources>
<SolidColorBrush x:Key="bgcolor" Color="green"/><SolidColorBrush x:Key="fgcolor" Color="yellow"/>
</Window.Resources>
2. Let us now bind the above created resource with Button. like this:
<Button Background="{StaticResource bgcolor}" Foreground="{StaticResource fgcolor}" Height="32">
A button with Resource attached to it.
</Button>
3. Now Run Your Application ...........F5.
NOTE :
bgcolor: Background Color.
fgcolor : Foreground Color
Thank you sir. Your code really works and it was very helpful. :)
ReplyDelete