Mega Code Archive

 
Categories / VB.Net Tutorial / WPF
 

Using resources to define global styles

<Page     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">     <Page.Resources>         <SolidColorBrush x:Key="RedBrush" Color="red"/>         <SolidColorBrush x:Key="BlueBrush" Color="blue"/>     </Page.Resources>     <StackPanel>         <Button Background="{StaticResource RedBrush}" />         <Ellipse Fill="{StaticResource BlueBrush}" Margin="40" Width="15" Height="25"/>     </StackPanel> </Page>