Click here to Skip to main content
15,881,755 members
Articles / Desktop Programming / WPF

PlantUML Editor: A Fast and Simple UML Editor using WPF

Rate me:
Please Sign up or sign in to vote.
4.98/5 (65 votes)
11 Jun 2011CPOL16 min read 233.9K   6.4K   233  
A WPF smart client to generate UML diagrams from plain text using plantuml tool
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:System="clr-namespace:System;assembly=mscorlib">

    <!-- NormalBrush is used as the Background for SimpleButton, SimpleRepeatButton -->
    <LinearGradientBrush x:Key="NormalBrush" EndPoint="0,1" StartPoint="0,0">
        <GradientStop Color="#EEE" Offset="0.0" />
        <GradientStop Color="#CCC" Offset="1.0" />
    </LinearGradientBrush>

    <!-- LightBrush is used for content areas such as Menu, Tab Control background -->
    <LinearGradientBrush x:Key="LightBrush" EndPoint="0,1" StartPoint="0,0">
        <GradientStop Color="#FFF" Offset="0.0" />
        <GradientStop Color="#EEE" Offset="1.0" />
    </LinearGradientBrush>

    <!-- PressedBrush is used for Pressed in Button, Radio Button, CheckBox -->
    <LinearGradientBrush x:Key="PressedBrush" EndPoint="0,1" StartPoint="0,0">
        <GradientStop Color="#FFB3C1D4" Offset="0" />
        <GradientStop Color="#FF8A9AA9" Offset="1" />
        <GradientStop Color="#FFC1D1E5" Offset="0.465" />
        <GradientStop Color="#FF91A2B2" Offset="0.485" />
        <GradientStop Color="#FFC0D0E4" Offset="0.48" />
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="PressedBorderBrush" EndPoint="0,1" StartPoint="0,0">
        <GradientStop Color="#444" Offset="0.0" />
        <GradientStop Color="#888" Offset="1.0" />
    </LinearGradientBrush>

    <!-- Disabled Brushes are used for the Disabled look of each control -->
    <SolidColorBrush x:Key="DisabledForegroundBrush" Color="#888" />
    <SolidColorBrush x:Key="DisabledBackgroundBrush" Color="#EEE" />
    <SolidColorBrush x:Key="DisabledBorderBrush" Color="#AAA" />

    <!-- DefaultedBorderBrush is used to show KeyBoardFocus -->
    <LinearGradientBrush x:Key="DefaultedBorderBrush" EndPoint="0,1" StartPoint="0,0">
        <GradientStop Color="#777" Offset="0.0" />
        <GradientStop Color="#000" Offset="1.0" />
    </LinearGradientBrush>

    <!-- Style and Template pairs are used to define each control Part -->
    <!-- The Style provides default values on the control; the Template gives the elements for each control -->

    <LinearGradientBrush x:Key="SelectedListBoxBrush" EndPoint="1,0.5" StartPoint="0,0.5">
        <GradientStop Color="#33F7F7F7" Offset="0" />
        <GradientStop Color="#00FFFFFF" Offset="0.98" />
    </LinearGradientBrush>

    <SolidColorBrush x:Key="SolidBorderBrush" Color="#888" />

    <!-- This is the thickness setting for most borders -->
    <Thickness x:Key="BorderThickness">1,1,1,1</Thickness>

    <!-- Padding value for labels -->
    <Thickness x:Key="LabelPadding">5,8,5,2</Thickness>

    <!-- SolidColorBrushes, LinearGradientBrushes, and DrawingBrushes-->

    <!-- The Background Brush is used as the background for the Main Window -->
    <SolidColorBrush x:Key="MainBackgroundBrush" Color="#FF202020" />

    <!-- The Background Brush is used as the background for the Headers and Footers -->
    <SolidColorBrush x:Key="BackgroundBrush" Color="#FF202020" />

    <!-- The Panel Gradient Brush is used as the background for the panels such as the Details Panel -->
    <LinearGradientBrush x:Key="PanelGradientBrush" EndPoint="1,0.5" StartPoint="0,0.5">
        <GradientStop Color="#FF555555" Offset="0" />
        <GradientStop Color="#FF1C1C1C" Offset="1" />
    </LinearGradientBrush>

    <!-- The Diagram Gradient Brush is used as the background for the Diagram area-->
    <LinearGradientBrush x:Key="DiagramGradientBrush" EndPoint="0.439,0.967" StartPoint="0.561,0.033">
        <GradientStop Color="#FF202020" Offset="0" />
        <GradientStop Color="#FF545454" Offset="1" />
    </LinearGradientBrush>

    <SolidColorBrush x:Key="PersonInfoBackgroundBrush" Color="#FF282828" />

    <SolidColorBrush x:Key="PhotosBackgroundBrush" Color="#FF000000" />

    <!-- Colors used for the Welcome Header -->
    <SolidColorBrush x:Key="WelcomeBackgroundBrush" Color="#FF202020" />
    <SolidColorBrush x:Key="WelcomeHeaderFontColor" Color="#FFE6E6E6" />

    <!-- This is a color setting for text -->
    <SolidColorBrush x:Key="FontColor" Color="#FFE6E6E6" />

    <SolidColorBrush x:Key="HeaderFontColor" Color="#FFE6E6E6" />

    <SolidColorBrush x:Key="InputFontColor" Color="#FFE6E6E6" />

    <SolidColorBrush x:Key="GridHeaderFontColor" Color="#FF888888" />

    <SolidColorBrush x:Key="AlternateFontColor" Color="#FF888888" />

    <SolidColorBrush x:Key="SharedBirthdaysGroupHeaderColor" Color="#FFAAAAAA" />

    <!-- The Border Brush is used as the color for most borders -->
    <SolidColorBrush x:Key="BorderBrush" Color="#FF4E4E4E" />

    <!-- The Input Background Brush is used as the background for Input areas -->
    <LinearGradientBrush x:Key="InputBackgroundBrush" EndPoint="0.504,0.351" StartPoint="0.504,-0.319">
        <GradientStop Color="#FF000000" Offset="0.416" />
        <GradientStop Color="#FF4A5790" Offset="0.54" />
    </LinearGradientBrush>

    <DrawingBrush x:Key="PersonFigureFill" Stretch="Uniform">
        <DrawingBrush.Drawing>
            <DrawingGroup>
                <GeometryDrawing Geometry="F1 M 6.53515625,4.4921875 C 6.53515625,2.01171875 8.546875,0 11.029296875,0 C 13.509765625,0 15.521484375,2.01171875 15.521484375,4.4921875 C 15.521484375,6.974609375 13.509765625,8.986328125 11.029296875,8.986328125 C 8.546875,8.986328125 6.53515625,6.974609375 6.53515625,4.4921875 Z" Brush="#FFFFFFFF" />
                <GeometryDrawing Geometry="F1 M 12.05078125,25.939453125 C 12.05078125,25.939453125 12.05078125,40.1640625 12.05078125,41.490234375 C 12.05078125,42.818359375 13.990234375,43.533203125 14.806640625,43.533203125 C 15.625,43.533203125 17.0546875,43.431640625 17.0546875,41.6953125 C 17.0546875,39.958984375 17.0546875,15.521484375 17.0546875,15.521484375 C 17.0546875,15.521484375 18.5859375,15.521484375 18.5859375,15.521484375 C 18.5859375,15.521484375 18.5859375,23.693359375 18.5859375,24.91796875 C 18.5859375,26.14453125 19.810546875,26.451171875 20.525390625,26.451171875 C 21.240234375,26.451171875 22.466796875,26.349609375 22.466796875,25.123046875 C 22.466796875,23.8984375 22.16015625,16.236328125 22.16015625,14.1953125 C 22.16015625,12.15234375 20.73046875,9.498046875 17.2578125,9.498046875 C 17.2578125,9.498046875 5.20703125,9.498046875 5.20703125,9.498046875 C 1.736328125,9.498046875 0.306640625,12.15234375 0.306640625,14.1953125 C 0.306640625,16.236328125 0,23.8984375 0,25.123046875 C 0,26.349609375 1.224609375,26.451171875 1.939453125,26.451171875 C 2.654296875,26.451171875 3.880859375,26.14453125 3.880859375,24.91796875 C 3.880859375,23.693359375 3.880859375,15.521484375 3.880859375,15.521484375 C 3.880859375,15.521484375 5.412109375,15.521484375 5.412109375,15.521484375 C 5.412109375,15.521484375 5.412109375,39.958984375 5.412109375,41.6953125 C 5.412109375,43.431640625 6.841796875,43.533203125 7.658203125,43.533203125 C 8.4765625,43.533203125 10.416015625,42.818359375 10.416015625,41.490234375 C 10.416015625,40.1640625 10.416015625,25.939453125 10.416015625,25.939453125 C 10.416015625,25.939453125 12.05078125,25.939453125 12.05078125,25.939453125 Z" Brush="#FFFFFFFF" />
            </DrawingGroup>
        </DrawingBrush.Drawing>
    </DrawingBrush>

    <SolidColorBrush x:Key="LogoBrush" Color="#FF93999C" />
 
    <!-- MenuPressedBrush - This brush is used for the Main Menu pressed and focused state-->
    <LinearGradientBrush x:Key="MenuPressedBrush" StartPoint="0.500023,0.999996" EndPoint="0.500023,4.37507e-006">
        <GradientStop Color="#FF875225" Offset="0" />
        <GradientStop Color="#FF221E1F" Offset="0.960674" />
        <GradientStop Color="#FF221E1F" Offset="1" />
    </LinearGradientBrush>

    <SolidColorBrush x:Key="PopupMenuBackgroundBrush" Color="#FF000000" />

    <LinearGradientBrush x:Key="MenuIsHighlightedBrush" StartPoint="0.5,0.999996" EndPoint="0.5,4.37507e-006">
        <GradientStop Color="#FF4C4D4F" Offset="0" />
        <GradientStop Color="#FF4C4D4F" Offset="0.0280899" />
        <GradientStop Color="#FF221E1F" Offset="0.775281" />
        <GradientStop Color="#FF221E1F" Offset="1" />
    </LinearGradientBrush>

    <SolidColorBrush x:Key="ListViewFontColor" Color="#FFFA6E15" />

    <!-- ButtonBorderBrush is used as the Border for buttons  -->
    <LinearGradientBrush x:Key="ButtonBorderBrush" EndPoint="0,1" StartPoint="0,0">
        <GradientStop Color="#CCC" Offset="0.0" />
        <GradientStop Color="#444" Offset="1.0" />
    </LinearGradientBrush>

    <!-- MenuBorderBrush is used as the Border for MenuItems -->
    <LinearGradientBrush x:Key="MenuBorderBrush" EndPoint="0,1" StartPoint="0,0">
        <GradientStop Color="#CCC" Offset="0.0" />
        <GradientStop Color="#444" Offset="1.0" />
    </LinearGradientBrush>

    <!-- Disabled Brushes are used for the Disabled look of each control -->

    <SolidColorBrush x:Key="DisabledMenuForegroundBrush" Color="#888" />


    <!-- This BitmapEffect is used by the Simple MenuItem -->
    <DropShadowBitmapEffect x:Key="PopupDropShadow" ShadowDepth="1.5" Softness="0.15" />

    <SolidColorBrush x:Key="TextBlockForegroundBrush" Color="#FFFA6E15" />

    <LinearGradientBrush x:Key="HeaderBackgroundBrush" StartPoint="0.499999,0.00908135" EndPoint="0.499999,1.17275">
        <GradientStop Color="#D43B4A87" Offset="0" />
        <GradientStop Color="#D43B4A87" Offset="0.0236486" />
        <GradientStop Color="#D409242A" Offset="1" />
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="SelectedHeaderBackgroundBrush" StartPoint="0.499999,0.00908135" EndPoint="0.499999,1.17275">
        <GradientStop Color="#D44F5E8E" Offset="0" />
        <GradientStop Color="#D44F5E8E" Offset="0.0236486" />
        <GradientStop Color="#D44B5378" Offset="1" />
    </LinearGradientBrush>

    <SolidColorBrush x:Key="HeaderBorderBrush" Color="#FF979797" />

    <SolidColorBrush x:Key="DataGridSelectedHeaderFontColor" Color="#FFFFFFFF" />

    <SolidColorBrush x:Key="FlowDocumentFontColor" Color="#FFFFFF" />

    <!-- Control Resources-->

    <!-- This is the style for most borders -->
    <Style x:Key="BorderStyle" TargetType="{x:Type Border}">
        <Setter Property="BorderThickness" Value="{DynamicResource BorderThickness}" />
        <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}" />
        <Setter Property="CornerRadius" Value="10,10,10,10" />
    </Style>

  <!-- This is the default style for all labels -->
    <Style TargetType="{x:Type Label}">
        <Setter Property="Foreground" Value="{DynamicResource FontColor}" />
        <Setter Property="FontWeight" Value="Normal" />
        <Setter Property="Padding" Value="{DynamicResource LabelPadding}" />
        <!--<Setter Property="FontFamily" Value="Calibri" />-->
        <Setter Property="FontSize" Value="13" />
    </Style>

    <!-- This is the default style for all textblocks -->
    <Style TargetType="{x:Type TextBlock}">
        <!--<Setter Property="FontFamily" Value="Calibri" />-->
        <Setter Property="Foreground" Value="White" />
    </Style>

    <!-- This is the default style for all radio buttons -->
    <Style TargetType="{x:Type RadioButton}">
        <Setter Property="Foreground" Value="{DynamicResource FontColor}" />
    </Style>

    <Style TargetType="{x:Type TextBox}">
        <Setter Property="Margin" Value="2, 2, 2, 2" />
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0,-0.1" StartPoint="0,0.4">
                    <GradientStop Color="#777" Offset="1.0" />
                    <GradientStop Color="White" Offset="0.25" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type GridViewColumnHeader}">
        <Setter Property="GridViewColumnHeader.Template">
            <Setter.Value>
                <ControlTemplate>
                    <TextBlock Margin="2,0,0,2" Text="{TemplateBinding GridViewColumnHeader.Content}" TextAlignment="Left" VerticalAlignment="Center" Foreground="{DynamicResource GridHeaderFontColor}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="NameGridViewColumnHeader" TargetType="{x:Type GridViewColumnHeader}">
        <Setter Property="GridViewColumnHeader.Template">
            <Setter.Value>
                <ControlTemplate>
                    <TextBlock Margin="4,0,0,2" Text="{TemplateBinding GridViewColumnHeader.Content}" TextAlignment="Left" VerticalAlignment="Center" Foreground="{DynamicResource GridHeaderFontColor}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="HeaderStyle" TargetType="{x:Type TextBlock}">
        <!--<Setter Property="FontFamily" Value="Calibri" />-->
        <Setter Property="FontSize" Value="18" />
        <Setter Property="Foreground" Value="{DynamicResource FontColor}" />
        <Setter Property="Margin" Value="10,0,10,10" />
    </Style>

    <Style x:Key="SectionHeaderStyle" TargetType="{x:Type TextBlock}">
        <Setter Property="TextWrapping" Value="NoWrap" />
        <Setter Property="TextTrimming" Value="None" />
        <Setter Property="Foreground" Value="{DynamicResource FontColor}" />
        <Setter Property="FontWeight" Value="Bold" />
        <!--<Setter Property="FontFamily" Value="Calibri" />-->
        <Setter Property="FontSize" Value="13" />
    </Style>

    <Style x:Key="DetailsBorderStyle" TargetType="{x:Type Border}">
        <Setter Property="CornerRadius" Value="10,10,10,10" />
        <Setter Property="BorderThickness" Value="1,1,1,1" />
        <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}" />
        <Setter Property="Margin" Value="10,10,10,0" />
        <Setter Property="Padding" Value="5,5,5,5" />
        <Setter Property="Background" Value="#FF262626" />
    </Style>

    <Style x:Key="NormalButtonStyle" TargetType="{x:Type Button}">
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Foreground" Value="#FFFFFF" />
        <Setter Property="Width" Value="Auto" />
        <Setter Property="Height" Value="24" />
        <Setter Property="FontSize" Value="12" />
        <Setter Property="Padding" Value="4" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Rectangle x:Name="Rectangle" Stroke="#FF051F42" StrokeMiterLimit="1.000000" StrokeThickness="0.500000" RadiusX="5" RadiusY="5">
                            <Rectangle.Fill>
                                <LinearGradientBrush EndPoint="0.501,0.039" StartPoint="0.501,0.971">
                                    <GradientStop Color="#FF1F317D" Offset="0.101" />
                                    <GradientStop Color="#FF1F317D" Offset="0.49" />
                                    <GradientStop Color="#FF6C8EBD" Offset="0.51" />
                                    <GradientStop Color="#FF283D8C" Offset="0" />
                                    <GradientStop Color="#FF7094C7" Offset="0.986" />
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Border Padding="{TemplateBinding Padding}">
                            <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" />
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="true" />
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Fill" TargetName="Rectangle">
                                <Setter.Value>
                                    <LinearGradientBrush EndPoint="0.501,0.039" StartPoint="0.501,0.971">
                                        <GradientStop Color="#FF2C558C" Offset="0.101" />
                                        <GradientStop Color="#FF1F317D" Offset="0.49" />
                                        <GradientStop Color="#FF9DB5D7" Offset="0.51" />
                                        <GradientStop Color="#FF244AAF" Offset="0" />
                                        <GradientStop Color="#FF87A4D9" Offset="0.986" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="BlackButtonStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource NormalButtonStyle}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Rectangle Stroke="#FF000000" StrokeMiterLimit="1.000000" StrokeThickness="0.500000" RadiusX="5" RadiusY="5" x:Name="rectangle">
                            <Rectangle.Fill>
                                <LinearGradientBrush EndPoint="0.501,0.039" StartPoint="0.501,0.971">
                                    <GradientStop Color="#FF1E1E1E" Offset="0.101" />
                                    <GradientStop Color="#FF1E1E1E" Offset="0.49" />
                                    <GradientStop Color="#FF5B5959" Offset="0.51" />
                                    <GradientStop Color="#FF2F2F2F" Offset="0" />
                                    <GradientStop Color="#FF5B5959" Offset="0.986" />
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Border Padding="{TemplateBinding Padding}">
                            <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" />
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="true" />
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Fill" TargetName="rectangle">
                                <Setter.Value>
                                    <LinearGradientBrush EndPoint="0.501,0.039" StartPoint="0.501,0.971">
                                        <GradientStop Color="#FF3A3A3A" Offset="0.101" />
                                        <GradientStop Color="#FF1E1E1E" Offset="0.49" />
                                        <GradientStop Color="#FFB0B0B0" Offset="0.51" />
                                        <GradientStop Color="#FF656565" Offset="0" />
                                        <GradientStop Color="#FF989898" Offset="0.938" />
                                        <GradientStop Color="#FF7F7F7F" Offset="0.986" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="RedButtonStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource NormalButtonStyle}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Rectangle Stroke="#FF570606" StrokeMiterLimit="1.000000" StrokeThickness="0.500000" RadiusX="5" RadiusY="5" x:Name="rectangle">
                            <Rectangle.Fill>
                                <LinearGradientBrush EndPoint="0.501,0.039" StartPoint="0.501,0.971">
                                    <GradientStop Color="#FF860E0E" Offset="0.101" />
                                    <GradientStop Color="#FF9C0F0F" Offset="0.49" />
                                    <GradientStop Color="#FFD17575" Offset="0.51" />
                                    <GradientStop Color="#FFA41313" Offset="0" />
                                    <GradientStop Color="#FFD57777" Offset="0.986" />
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Border Padding="{TemplateBinding Padding}">
                            <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" />
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="true" />
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Fill" TargetName="rectangle">
                                <Setter.Value>
                                    <LinearGradientBrush EndPoint="0.501,0.039" StartPoint="0.501,0.971">
                                        <GradientStop Color="#FF9E4E4E" Offset="0.101" />
                                        <GradientStop Color="#FF9C0F0F" Offset="0.49" />
                                        <GradientStop Color="#FFE79C9C" Offset="0.51" />
                                        <GradientStop Color="#FF656565" Offset="0" />
                                        <GradientStop Color="#FFE57E7E" Offset="0.986" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    
    
    <ControlTemplate x:Key="GlassButtonTemplate" TargetType="{x:Type Button}">
        <ControlTemplate.Resources>
            <Storyboard x:Key="Timeline1">
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="glow" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>
            <Storyboard x:Key="Timeline2">
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="glow" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>
        </ControlTemplate.Resources>
        <Border BorderBrush="#FFFFFFFF" BorderThickness="1,1,1,1" CornerRadius="4,4,4,4">
            <Border x:Name="border" Background="#7F000000" BorderBrush="#FF000000" BorderThickness="1,1,1,1" CornerRadius="4,4,4,4">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="0.507*"/>
                        <RowDefinition Height="0.493*"/>
                    </Grid.RowDefinitions>
                    <Border Opacity="0" HorizontalAlignment="Stretch" x:Name="glow" Width="Auto" Grid.RowSpan="2" CornerRadius="4,4,4,4">
                        <Border.Background>
                            <RadialGradientBrush>
                                <RadialGradientBrush.RelativeTransform>
                                    <TransformGroup>
                                        <ScaleTransform ScaleX="1.702" ScaleY="2.243"/>
                                        <SkewTransform AngleX="0" AngleY="0"/>
                                        <RotateTransform Angle="0"/>
                                        <TranslateTransform X="-0.368" Y="-0.152"/>
                                    </TransformGroup>
                                </RadialGradientBrush.RelativeTransform>
                                <GradientStop Color="#B28DBDFF" Offset="0"/>
                                <GradientStop Color="#008DBDFF" Offset="1"/>
                            </RadialGradientBrush>
                        </Border.Background>
                    </Border>
                    <ContentPresenter Grid.RowSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center" Width="Auto" Margin="{TemplateBinding Padding}" />
                    <Border HorizontalAlignment="Stretch" Margin="0,0,0,0" x:Name="shine" Width="Auto" CornerRadius="4,4,0,0">
                        <Border.Background>
                            <LinearGradientBrush EndPoint="0.494,0.889" StartPoint="0.494,0.028">
                                <GradientStop Color="#99FFFFFF" Offset="0"/>
                                <GradientStop Color="#33FFFFFF" Offset="1"/>
                            </LinearGradientBrush>
                        </Border.Background>
                    </Border>
                </Grid>
            </Border>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Opacity" TargetName="shine" Value="0.4"/>
                <Setter Property="Background" TargetName="border" Value="#CC000000"/>
                <Setter Property="Visibility" TargetName="glow" Value="Hidden"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
                <Trigger.EnterActions>
                    <BeginStoryboard Storyboard="{StaticResource Timeline1}"/>
                </Trigger.EnterActions>
                <Trigger.ExitActions>
                    <BeginStoryboard x:Name="Timeline2_BeginStoryboard" Storyboard="{StaticResource Timeline2}"/>
                </Trigger.ExitActions>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    
    <!--This sets the default style for all buttons-->
    <Style TargetType="{x:Type Button}" BasedOn="{x:Null}">
        <Setter Property="Height" Value="30" />
        <Setter Property="Foreground" Value="White" />
        <Setter Property="Padding" Value="4,0,4,0" />
    </Style> 

    <!-- Repeat Button Style - This is used by ScrollBar for the up and down buttons -->
    <Style x:Key="RepeatButtonStyle" TargetType="{x:Type RepeatButton}" BasedOn="{x:Null}">
        <Setter Property="Background" Value="{DynamicResource NormalBrush}" />
        <Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Grid>
                        <Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" />
                        <ContentPresenter HorizontalAlignment="Center" x:Name="ContentPresenter" VerticalAlignment="Center" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="true">
                            <Setter Property="BorderBrush" Value="{DynamicResource DefaultedBorderBrush}" TargetName="Border" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter Property="Background" Value="{DynamicResource PressedBrush}" TargetName="Border" />
                            <Setter Property="BorderBrush" Value="{DynamicResource PressedBorderBrush}" TargetName="Border" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border" />
                            <Setter Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" TargetName="Border" />
                            <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Thumb Style - The Thumb is the draggable part of the Scrollbar -->
    <Style x:Key="ThumbStyle" TargetType="{x:Type Thumb}" BasedOn="{x:Null}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Grid Margin="0,0,0,0" x:Name="Grid">
                        <Rectangle HorizontalAlignment="Stretch" x:Name="Rectangle" VerticalAlignment="Stretch" Width="Auto" Height="Auto" RadiusX="2" RadiusY="2" Fill="#FF414C6F" Stroke="#FFFFFFFF" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsFocused" Value="True" />
                        <Trigger Property="IsMouseOver" Value="True" />
                        <Trigger Property="IsEnabled" Value="False" />
                        <Trigger Property="IsDragging" Value="True" />
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- ScrollRepeatButton Style - This RepeatButton is used above and below the Thumb in the Scrollbar. They are set to transparent si that they do not show over the scrollbar -->
    <Style x:Key="ScrollRepeatButtonStyle" TargetType="{x:Type RepeatButton}">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="IsTabStop" Value="false" />
        <Setter Property="Focusable" Value="false" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Grid>
                        <Rectangle Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding BorderThickness}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- ScrollBar  This makes use of Thumb, RepeatButton and ScrollRepeatButton -->
    <Style TargetType="{x:Type ScrollBar}">
        <Setter Property="Stylus.IsFlicksEnabled" Value="false" />
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ScrollBar}">
                    <Grid x:Name="GridRoot" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}">
                        <Grid.RowDefinitions>
                            <RowDefinition MaxHeight="18" />
                            <RowDefinition Height="0.00001*" />
                            <RowDefinition MaxHeight="18" />
                        </Grid.RowDefinitions>

                        <RepeatButton x:Name="DecreaseRepeat" Style="{DynamicResource RepeatButtonStyle}" Command="ScrollBar.LineUpCommand" Background="{x:Null}" BorderBrush="{x:Null}" BorderThickness="0,0,0,0">
                            <Grid>
                                <Path x:Name="DecreaseArrow" StrokeThickness="1" Data="M 0 4 L 8 4 L 4 0 Z" RenderTransformOrigin="0.5,0.5" Stroke="#FFFFFFFF" Margin="0.75,0,-0.757,0" />
                            </Grid>
                        </RepeatButton>

                        <!-- Track is a special layout container which sizes the thumb and the repeat button which do jump scrolling either side of it -->
                        <Track Grid.Row="1" x:Name="PART_Track" Orientation="Vertical" IsDirectionReversed="true">
                            <Track.Thumb>
                                <Thumb Style="{DynamicResource ThumbStyle}" Width="10" />
                            </Track.Thumb>
                            <Track.IncreaseRepeatButton>
                                <RepeatButton x:Name="PageUp" Style="{DynamicResource ScrollRepeatButtonStyle}" Command="ScrollBar.PageDownCommand" />
                            </Track.IncreaseRepeatButton>
                            <Track.DecreaseRepeatButton>
                                <RepeatButton x:Name="PageDown" Style="{DynamicResource ScrollRepeatButtonStyle}" Command="ScrollBar.PageUpCommand" />
                            </Track.DecreaseRepeatButton>
                        </Track>

                        <RepeatButton Grid.Row="2" x:Name="IncreaseRepeat" Style="{DynamicResource RepeatButtonStyle}" Command="ScrollBar.LineDownCommand" Background="{x:Null}" BorderBrush="{x:Null}" BorderThickness="0,0,0,0">
                            <Grid>
                                <Path x:Name="IncreaseArrow" StrokeThickness="1" Data="M 0 0 L 4 4 L 8 0 Z" RenderTransformOrigin="0.5,0.5" Stroke="#FFFFFFFF" Margin="0.75,0,-0.757,0" />
                            </Grid>
                        </RepeatButton>
                    </Grid>

                    <!-- This uses a single template for ScrollBar and rotate it to be Horizontal
					It also changes the commands so that the it does Left and Right instead of Up and Down Commands -->
                    <ControlTemplate.Triggers>
                        <Trigger Property="Orientation" Value="Horizontal">

                            <!-- Rotate the ScrollBar from Vertical to Horizontal -->
                            <Setter Property="LayoutTransform" TargetName="GridRoot">
                                <Setter.Value>
                                    <RotateTransform Angle="-90" />
                                </Setter.Value>
                            </Setter>

                            <!-- Track is bound to Orientation internally, so we need to rotate it back to Vertical -->
                            <Setter TargetName="PART_Track" Property="Orientation" Value="Vertical" />

                            <!-- Change the commands to do Horizontal commands -->
                            <Setter Property="Command" Value="ScrollBar.LineLeftCommand" TargetName="DecreaseRepeat" />
                            <Setter Property="Command" Value="ScrollBar.LineRightCommand" TargetName="IncreaseRepeat" />
                            <Setter Property="Command" Value="ScrollBar.PageLeftCommand" TargetName="PageDown" />
                            <Setter Property="Command" Value="ScrollBar.PageRightCommand" TargetName="PageUp" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- User for styling the foreground color, applied to all MenuItems  -->
    <Style TargetType="{x:Type MenuItem}">
        <Setter Property="Foreground" Value="#FFFFFFFF" />
    </Style>

    <!-- Main Menu - This template uses a StackPanel to layout MenuItems -->
    <Style x:Key="MenuStyle" TargetType="{x:Type Menu}">
        <Setter Property="Background" Value="{x:Null}" />
        <Setter Property="BorderBrush" Value="{DynamicResource MenuBorderBrush}" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Menu}">
                    <Grid>
                        <Border Margin="1" x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" />
                        <StackPanel Background="{TemplateBinding Background}" IsItemsHost="True" ClipToBounds="True" Orientation="Horizontal" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border" />
                            <Setter Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" TargetName="Border" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

  <!-- Main Menu - This template uses a StackPanel to layout MenuItems -->
  <Style x:Key="ContextMenuStyle" TargetType="{x:Type ContextMenu}">
    <Setter Property="Background" Value="Black" />
    <Setter Property="BorderBrush" Value="{DynamicResource MenuBorderBrush}" />
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ContextMenu}">
          <Grid>
            <Border Margin="1" x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" />
            <StackPanel Margin="5" Background="{TemplateBinding Background}" IsItemsHost="True" ClipToBounds="True" Orientation="Vertical" />
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border" />
              <Setter Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" TargetName="Border" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- MenuItem - The template uses triggers to provide four different arrangements of menu item which are set via the Role property -->
    <Style x:Key="MenuItemStyle" TargetType="{x:Type MenuItem}">
        <Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
        <Setter Property="VerticalContentAlignment" Value="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Foreground" Value="{DynamicResource FontColor}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type MenuItem}">
                    <Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{x:Null}" BorderThickness="1,1,1,1" CornerRadius="3,3,3,3" Margin="2,2,10,2">
                        <Grid>

                            <!-- The Grid is used to hold together columns for an Content and Arrow to show the next level
							 Size sharing is used in Grid so that the Icon, Content, Arrow for each MenuItem align together -->
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="14" />
                            </Grid.ColumnDefinitions>

                            <!-- Content for the menu text etc -->
                            <ContentPresenter Margin="{TemplateBinding Padding}" x:Name="HeaderHost" RecognizesAccessKey="True" ContentSource="Header" />

                            <!-- Arrow drawn path which points to the next level of the menu -->
                            <Grid Grid.Column="1" Margin="0,0,6,0" x:Name="ArrowPanel" VerticalAlignment="Center">
                                <Path x:Name="ArrowPanelPath" Fill="{TemplateBinding Foreground}" VerticalAlignment="Center" Data="M-1.0089707E-11,0.0050000012 L8.03125,-3.5155176E-24 3.9995833,4.095 z" Height="4.095" />
                            </Grid>

                            <!-- The Popup is the body of the menu which expands down or across depending on the level of the item -->
                            <Popup IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" x:Name="SubMenuPopup" Focusable="false" AllowsTransparency="true" VerticalOffset="0" PopupAnimation="Slide">
                                <Grid x:Name="SubMenu">
                                    <Border x:Name="SubMenuBorder" Background="{DynamicResource PopupMenuBackgroundBrush}" BorderBrush="{DynamicResource SolidBorderBrush}" BorderThickness="1" />
                                    <!-- StackPanel holds children of the menu. This is set bu IsItemsHost=True -->
                                    <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" />
                                </Grid>
                            </Popup>

                        </Grid>
                    </Border>

                    <!-- These triggers re-configure the four arrangements of MenuItem to show different levels of menu via Role -->
                    <ControlTemplate.Triggers>

                        <!-- Role = TopLevelHeader : this is the root menu item in a menu; the Popup expands down -->
                        <Trigger Property="Role" Value="TopLevelHeader">
                            <Setter Property="Margin" Value="0,1,0,1" />
                            <Setter Property="Padding" Value="6,3,6,3" />
                            <Setter Property="Placement" Value="Bottom" TargetName="SubMenuPopup" />
                        </Trigger>

                        <!-- Role = TopLevelItem :  this is a child menu item from the top level without any child items-->
                        <Trigger Property="Role" Value="TopLevelItem">
                            <Setter Property="Margin" Value="0,1,0,1" />
                            <Setter Property="Padding" Value="6,3,6,3" />
                            <Setter Property="Visibility" Value="Collapsed" TargetName="ArrowPanel" />
                        </Trigger>

                        <!-- Role = SubMenuHeader : this is a child menu item which does not have children -->
                        <Trigger Property="Role" Value="SubmenuHeader">
                            <Setter Property="DockPanel.Dock" Value="Top" />
                            <Setter Property="Padding" Value="0,2,0,2" />
                            <Setter Property="Grid.IsSharedSizeScope" Value="true" />
                        </Trigger>

                        <!-- Role = SubMenuItem : this is a child menu item which has children-->
                        <Trigger Property="Role" Value="SubmenuItem">
                            <Setter Property="DockPanel.Dock" Value="Top" />
                            <Setter Property="Padding" Value="0,2,0,2" />
                            <Setter Property="Visibility" Value="Collapsed" TargetName="ArrowPanel" />
                        </Trigger>
                        <Trigger Property="IsSuspendingPopupAnimation" Value="true">
                            <Setter Property="PopupAnimation" Value="None" TargetName="SubMenuPopup" />
                        </Trigger>

                        <Trigger Property="AllowsTransparency" SourceName="SubMenuPopup" Value="true">
                            <Setter Property="Margin" Value="0,0,3,3" TargetName="SubMenu" />
                            <Setter Property="SnapsToDevicePixels" Value="true" TargetName="SubMenu" />
                            <Setter Property="BitmapEffect" Value="{DynamicResource PopupDropShadow}" TargetName="SubMenuBorder" />
                        </Trigger>

                        <!-- Using the system colors for the Menu Highlight and IsEnabled-->
                        <Trigger Property="IsHighlighted" Value="true">
                            <Setter Property="Background" TargetName="Border" Value="{DynamicResource MenuIsHighlightedBrush}" />
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}" />
                            <Setter Property="BorderBrush" TargetName="Border" Value="#FF000000" />
                        </Trigger>

                        <Trigger Property="IsKeyboardFocused" Value="true">
                            <Setter Property="Background" TargetName="Border" Value="{DynamicResource MenuPressedBrush}" />
                        </Trigger>

                        <Trigger Property="IsPressed" Value="true">
                            <Setter Property="Background" TargetName="Border" Value="{DynamicResource MenuPressedBrush}" />
                        </Trigger>

                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{DynamicResource DisabledMenuForegroundBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style x:Key="ListViewStyle" TargetType="ListView">
        <Setter Property="Margin" Value="0,2,0,0" />
        <Setter Property="SnapsToDevicePixels" Value="true" />
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListView">
                    <Border Name="Border">
                        <ScrollViewer Style="{DynamicResource
                        {x:Static GridView.GridViewScrollViewerStyleKey}}">
                            <ItemsPresenter />
                        </ScrollViewer>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate x:Key="ListViewItemTemplate" TargetType='{x:Type ListViewItem}'>
        <Grid SnapsToDevicePixels="True" Margin="0,3,0,0">
            <Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" />
            <GridViewRowPresenter TextBlock.Foreground="{DynamicResource ListViewFontColor}" TextBlock.FontSize="11" Content="{TemplateBinding Content}" Columns="{TemplateBinding GridView.ColumnCollection}" />
        </Grid>
        <ControlTemplate.Triggers>
            <!-- Change IsSelected SelectedListBoxBrush to set the selection color for the items -->
            <Trigger Property="IsSelected" Value="true">
                <Setter Property="Background" Value="{DynamicResource SelectedListBoxBrush}" TargetName="Border" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style x:Key="ListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
        <Style.Resources>
            <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="AliceBlue"/>
            <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="AliceBlue"/>
        </Style.Resources>
    </Style>
    
    <LinearGradientBrush x:Key="DiagonalStripeGray" StartPoint="0,0" EndPoint="1,1" SpreadMethod="Repeat">
        <GradientStop Offset="0" Color="#FF101010"/>
        <GradientStop Offset="0.5" Color="#FF101010"/>
        <GradientStop Offset="0.5" Color="Black"/>
        <GradientStop Offset="1" Color="Black"/>

        <LinearGradientBrush.RelativeTransform>
            <ScaleTransform ScaleX="0.01" ScaleY="0.01"/>
        </LinearGradientBrush.RelativeTransform>
    </LinearGradientBrush>

    <SolidColorBrush x:Key="PanelBorderBrush" Color="Black" />

    <ControlTemplate x:Key="BlackPanelBorderTemplate" TargetType="{x:Type ContentControl}">
        <Grid>
            <Border Background="Silver"
                BorderBrush="{StaticResource PanelBorderBrush}"
                BorderThickness="1,1,1,1"
                CornerRadius="5,5,5,5">
                <Border Margin="3,3,3,3"
                    Background="#FF000000"
                    BorderBrush="{StaticResource PanelBorderBrush}"
                    BorderThickness="1,1,1,1"
                    CornerRadius="5,5,5,5">
                    <ContentPresenter Margin="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContentControl}},Path=Padding}" />
                </Border>
            </Border>
            <Rectangle Stroke="{x:Null}"
                   VerticalAlignment="Top"
                   Height="54">
                <Rectangle.Fill>
                    <LinearGradientBrush EndPoint="0.5,0.815"
                                     StartPoint="0.5,0.241">
                        <GradientStop Color="#57FFFFFF"
                                  Offset="0" />
                        <GradientStop Color="#00FFFFFF"
                                  Offset="1" />
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>
            <Grid.BitmapEffect>
                <DropShadowBitmapEffect Color="Black"
                                    Direction="315"
                                    ShadowDepth="1"
                                    Softness="0.5"
                                    Opacity="0.5" />
            </Grid.BitmapEffect>
        </Grid>
    </ControlTemplate>

    <Style x:Key="RadioButtonListBoxItem" TargetType="{x:Type ListBoxItem}" >
        <Setter Property="Margin" Value="2, 2, 2, 0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border Background="Transparent">
                        <RadioButton IsHitTestVisible="False" Focusable="False" Foreground="{Binding Path=Foreground, RelativeSource='{RelativeSource TemplatedParent}',Mode=OneWay}"
                                           Content="{TemplateBinding ContentPresenter.Content}"
                                           IsChecked="{Binding Path=IsSelected, RelativeSource='{RelativeSource TemplatedParent}',Mode=TwoWay}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="RadioButtonListBoxStyle" TargetType="{x:Type ListBox}">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="KeyboardNavigation.DirectionalNavigation" Value="Cycle" />
        <Setter Property="BorderBrush" Value="Transparent" />                                         
    </Style>
    
    <DrawingBrush x:Key="MainBackground" Viewbox="0,0,1016,766" ViewboxUnits="Absolute" >
        <DrawingBrush.Drawing >
            <ImageDrawing Rect="0,0,1016,766" >
                <ImageDrawing.ImageSource>
                    <BitmapImage  CacheOption="OnLoad" CreateOptions="IgnoreImageCache"  UriSource="bg_green.JPG"/>
                </ImageDrawing.ImageSource>
            </ImageDrawing>
        </DrawingBrush.Drawing>
    </DrawingBrush>

    <Style x:Key="MenuButtonStyle" BasedOn="{x:Null}" TargetType="{x:Type Button}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Rectangle Opacity="0" Fill="#66FFFFFF" Stroke="{x:Null}" StrokeThickness="0.5" HorizontalAlignment="Stretch" Margin="0,2,2,2" x:Name="rectangle" VerticalAlignment="Stretch"/>
                        <Path Fill="{x:Null}" Stretch="Fill" Stroke="#7FFFFFFF" StrokeThickness="1" HorizontalAlignment="Right" Margin="0,4,0.5,4" Width="1" Height="17" Grid.RowSpan="1" Data="M-87.28,4 L-87.28,17"/>
                        <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="10,0,10,0" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" TextElement.Foreground="#FFFFFFFF" RecognizesAccessKey="True"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsFocused" Value="True"/>
                        <Trigger Property="IsDefaulted" Value="True"/>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Opacity" TargetName="rectangle" Value="0.5"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Opacity" TargetName="rectangle" Value="1"/>
                            <Setter Property="Fill" TargetName="rectangle" Value="#FF000000"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False"/>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type PasswordBox}">
        <Setter Property="Margin" Value="2, 2, 2, 2" />
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0,-0.1" StartPoint="0,0.4">
                    <GradientStop Color="#777" Offset="1.0" />
                    <GradientStop Color="White" Offset="0.25" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect BT, UK (ex British Telecom)
United Kingdom United Kingdom

Comments and Discussions