<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="" Height="300" Width="300">
<Canvas>
<TextBlock Text="Brush from Predefined Color [ .Fill = new SolidColorBrush(Colors.Green); ]"/>
<Rectangle HorizontalAlignment="Left" Width="60" Height="20">
<Rectangle.Fill>
<SolidColorBrush Color="Green"/>
</Rectangle.Fill>
</Rectangle>
</Canvas>
</Window>
|