none
ListBox Style: silverlight 4

    Question

  • I have a custom listbox with custom listbox style and custom itemcontainerstyle. i have done this as a library project.

    it works fine while tested using another project.  in the dll i exposed a property called ListPanelStyle to change the listbox style from  test project. but , when i set listbox style from test project it is not set. what is the problem? give me a solution.......



    this is my style

    <UserControl.Resources>

            <!--Brushes & Borders -->

            <!-- Linear Gradient Brushes -->

            <LinearGradientBrush x:Key="BlueBackground" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FFDFEFFF" Offset="0"/>
                <GradientStop Color="#FF97BEDE" Offset="1"/>
            </LinearGradientBrush>

            <LinearGradientBrush x:Key="Fatal" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#e2202b" Offset="0"/>
                <GradientStop Color="#b3161f" Offset="1"/>
            </LinearGradientBrush>

            <LinearGradientBrush x:Key="Serious" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#ffea00" Offset="0"/>
                <GradientStop Color="#ff9c00" Offset="1"/>
            </LinearGradientBrush>

            <LinearGradientBrush x:Key="Slight" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#a7db17" Offset="0"/>
                <GradientStop Color="#8cc306" Offset="1"/>
            </LinearGradientBrush>

            <LinearGradientBrush x:Key="TabButtonBackground" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#e9f1f7" Offset="0"/>
                <GradientStop Color="#c5dff2" Offset="1"/>
            </LinearGradientBrush>

            <LinearGradientBrush x:Key="TitleBarBackground" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#c5ebff" Offset="0.5"/>
                <GradientStop Color="#9dd5f2" Offset="1"/>
            </LinearGradientBrush>

            <LinearGradientBrush x:Key="ApplicationBackground" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#e3f5ff" Offset="0"/>
                <GradientStop Color="#ceeaf8" Offset="1"/>
            </LinearGradientBrush>

            <LinearGradientBrush x:Key="MainTabSubMenu" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FFBFE0F4" Offset="0"/>
                <GradientStop Color="#FFAAD5F2" Offset="1"/>
            </LinearGradientBrush>


            <!-- Borders -->

            <SolidColorBrush x:Key="MainTabButtonContainerBorder" Color="#9fbacc"/>

            <SolidColorBrush x:Key="BorderBrush" Color="#FF6990B3"/>

            <SolidColorBrush x:Key="MainTabBorder" Color="#91b4cc"/>

            <SolidColorBrush x:Key="MainTabSubMenuBorder" Color="#86b2d1"/>


            <!-- Solid Colour Brushes -->

            <SolidColorBrush x:Key="BoxBrushColor" Color="White"/>

            <SolidColorBrush x:Key="Background" Color="White"/>

            <SolidColorBrush x:Key="AlternateRowColour" Color="#FFF2F5F9"/>

            <SolidColorBrush x:Key="ErrorRowColour" Color="#FFF7E0E0"/>

            <SolidColorBrush x:Key="FooterColour" Color="#FFE9F7FF"/>

            <SolidColorBrush x:Key="FontColour" Color="#0f5582"/>
            
            <!-- Validate Tooltip Template -->
            
            <ControlTemplate x:Key="ValidationToolTipTemplate">
                <Grid x:Name="Root" Margin="5,0" Opacity="0" RenderTransformOrigin="0,0">
                    <Grid.RenderTransform>
                        <TranslateTransform x:Name="xform" X="-25"/>
                    </Grid.RenderTransform>
                    <VisualStateManager.VisualStateGroups>
                        <VisualStateGroup x:Name="OpenStates">
                            <VisualStateGroup.Transitions>
                                <VisualTransition GeneratedDuration="0"/>
                                <VisualTransition GeneratedDuration="0:0:0.2" To="Open">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.2" To="0" Storyboard.TargetProperty="X" Storyboard.TargetName="xform">
                                            <DoubleAnimation.EasingFunction>
                                                <BackEase Amplitude=".3" EasingMode="EaseOut"/>
                                            </DoubleAnimation.EasingFunction>
                                        </DoubleAnimation>
                                        <DoubleAnimation Duration="0:0:0.2" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root"/>
                                    </Storyboard>
                                </VisualTransition>
                            </VisualStateGroup.Transitions>
                            <VisualState x:Name="Closed">
                                <Storyboard>
                                    <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root"/>
                                </Storyboard>
                            </VisualState>
                            <VisualState x:Name="Open">
                                <Storyboard>
                                    <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="X" Storyboard.TargetName="xform"/>
                                    <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root"/>
                                </Storyboard>
                            </VisualState>
                        </VisualStateGroup>
                    </VisualStateManager.VisualStateGroups>
                    <Border Background="#052A2E31" CornerRadius="5" Margin="4,4,-4,-4"/>
                    <Border Background="#152A2E31" CornerRadius="4" Margin="3,3,-3,-3"/>
                    <Border Background="#252A2E31" CornerRadius="3" Margin="2,2,-2,-2"/>
                    <Border Background="#352A2E31" CornerRadius="2" Margin="1,1,-1,-1"/>
                    <Border Background="#FFDC000C" CornerRadius="2"/>
                    <Border CornerRadius="2">
                        <TextBlock Foreground="White" MaxWidth="250" Margin="8,4,8,4" TextWrapping="Wrap" Text="{Binding (Validation.Errors)[0].ErrorContent}" UseLayoutRounding="false"/>
                    </Border>
                </Grid>
            </ControlTemplate>

            <!-- ScrollBar. -->

            <Style x:Key="ScrollBarStyleBlue" TargetType="ScrollBar">
                <Setter Property="MinWidth" Value="17"/>
                <Setter Property="MinHeight" Value="17"/>
                <Setter Property="IsTabStop" Value="False"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ScrollBar">
                            <Grid x:Name="Root">
                                <Grid.Resources>
                                    <ControlTemplate x:Key="RepeatButtonTemplate" TargetType="RepeatButton">
                                        <Grid x:Name="Root" Background="Transparent">
                                            <VisualStateManager.VisualStateGroups>
                                                <VisualStateGroup x:Name="CommonStates">
                                                    <VisualState x:Name="Normal"/>
                                                </VisualStateGroup>
                                            </VisualStateManager.VisualStateGroups>
                                        </Grid>
                                    </ControlTemplate>
                                    <ControlTemplate x:Key="HorizontalIncrementTemplate" TargetType="RepeatButton">
                                        <Grid x:Name="Root">
                                            <VisualStateManager.VisualStateGroups>
                                                <VisualStateGroup x:Name="CommonStates">
                                                    <VisualState x:Name="Normal"/>
                                                    <VisualState x:Name="MouseOver">
                                                        <Storyboard>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Background"/>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundGradient"/>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation"/>
                                                            <ColorAnimation Duration="0" To="#7FFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#CCFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#F2FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Pressed">
                                                        <Storyboard>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Background"/>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundGradient"/>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation"/>
                                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Highlight"/>
                                                            <ColorAnimation Duration="0" To="#6BFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#C6FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#EAFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#F4FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Disabled">
                                                        <Storyboard>
                                                            <DoubleAnimation Duration="0:0:0" To=".7" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledElement"/>
                                                        </Storyboard>
                                                    </VisualState>
                                                </VisualStateGroup>
                                            </VisualStateManager.VisualStateGroups>
                                            <Rectangle x:Name="Background" Fill="#FF1F3B53" Opacity="0" RadiusY="2" RadiusX="2" StrokeThickness="1">
                                                <Rectangle.Stroke>
                                                    <LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0">
                                                        <GradientStop Color="#FF647480" Offset="1"/>
                                                        <GradientStop Color="#FFAEB7BF" Offset="0"/>
                                                        <GradientStop Color="#FF919EA7" Offset="0.35"/>
                                                        <GradientStop Color="#FF7A8A99" Offset="0.35"/>
                                                    </LinearGradientBrush>
                                                </Rectangle.Stroke>
                                            </Rectangle>
                                            <Rectangle x:Name="BackgroundAnimation" Fill="#FF448DCA" Opacity="0" RadiusY="2" RadiusX="2" Stroke="#00000000" StrokeThickness="1"/>
                                            <Rectangle x:Name="BackgroundGradient" Margin="1" Opacity="0" RadiusY="1" RadiusX="1" Stroke="#FFFFFFFF" StrokeThickness="1">
                                                <Rectangle.Fill>
                                                    <LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
                                                        <GradientStop Color="#FFFFFFFF" Offset="0.013"/>
                                                        <GradientStop Color="#F9FFFFFF" Offset="0.375"/>
                                                        <GradientStop Color="#E5FFFFFF" Offset="0.603"/>
                                                        <GradientStop Color="#C6FFFFFF" Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Rectangle.Fill>
                                            </Rectangle>
                                            <Rectangle x:Name="Highlight" IsHitTestVisible="false" Margin="1" Opacity="0" RadiusY="1" RadiusX="1" Stroke="#FF6DBDD1" StrokeThickness="1"/>
                                            <Path Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z " Height="8" Stretch="Uniform" Width="4">
                                                <Path.Fill>
                                                    <SolidColorBrush x:Name="ButtonColor" Color="#FF333333"/>
                                                </Path.Fill>
                                            </Path>
                                            <Rectangle x:Name="DisabledElement" Fill="#FFFFFFFF" Opacity="0" RadiusY="2" RadiusX="2"/>
                                        </Grid>
                                    </ControlTemplate>
                                    <ControlTemplate x:Key="HorizontalDecrementTemplate" TargetType="RepeatButton">
                                        <Grid x:Name="Root">
                                            <VisualStateManager.VisualStateGroups>
                                                <VisualStateGroup x:Name="CommonStates">
                                                    <VisualState x:Name="Normal"/>
                                                    <VisualState x:Name="MouseOver">
                                                        <Storyboard>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Background"/>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundGradient"/>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundMouseOver"/>
                                                            <ColorAnimation Duration="0" To="#7FFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#CCFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#F2FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Pressed">
                                                        <Storyboard>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Background"/>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundGradient"/>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundPressed"/>
                                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Highlight"/>
                                                            <ColorAnimation Duration="0" To="#6BFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#C6FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#EAFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#F4FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Disabled">
                                                        <Storyboard>
                                                            <DoubleAnimation Duration="0:0:0" To=".7" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledElement"/>
                                                        </Storyboard>
                                                    </VisualState>
                                                </VisualStateGroup>
                                            </VisualStateManager.VisualStateGroups>
                                            <Rectangle x:Name="Background" Fill="#FF1F3B53" Opacity="0" RadiusY="2" RadiusX="2" StrokeThickness="1">
                                                <Rectangle.Stroke>
                                                    <LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0">
                                                        <GradientStop Color="#FF647480" Offset="1"/>
                                                        <GradientStop Color="#FFAEB7BF" Offset="0"/>
                                                        <GradientStop Color="#FF919EA7" Offset="0.35"/>
                                                        <GradientStop Color="#FF7A8A99" Offset="0.35"/>
                                                    </LinearGradientBrush>
                                                </Rectangle.Stroke>
                                            </Rectangle>
                                            <Rectangle x:Name="BackgroundMouseOver" Fill="#FF448DCA" Opacity="0" RadiusY="2" RadiusX="2" Stroke="#00000000" StrokeThickness="1"/>
                                            <Rectangle x:Name="BackgroundPressed" Fill="#FF448DCA" Opacity="0" RadiusY="2" RadiusX="2" Stroke="#00000000" StrokeThickness="1"/>
                                            <Rectangle x:Name="BackgroundGradient" Margin="1" Opacity="0" RadiusY="1" RadiusX="1" Stroke="#FFFFFFFF" StrokeThickness="1">
                                                <Rectangle.Fill>
                                                    <LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
                                                        <GradientStop Color="#FFFFFFFF" Offset="0.013"/>
                                                        <GradientStop Color="#F9FFFFFF" Offset="0.375"/>
                                                        <GradientStop Color="#E5FFFFFF" Offset="0.603"/>
                                                        <GradientStop Color="#C6FFFFFF" Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Rectangle.Fill>
                                            </Rectangle>
                                            <Rectangle x:Name="Highlight" IsHitTestVisible="false" Margin="1" Opacity="0" RadiusY="1" RadiusX="1" Stroke="#FF6DBDD1" StrokeThickness="1"/>
                                            <Path Data="F1 M 110.692,342.252L 110.692,352.682L 104.594,347.467L 110.692,342.252 Z " Height="8" Stretch="Uniform" Width="4">
                                                <Path.Fill>
                                                    <SolidColorBrush x:Name="ButtonColor" Color="#FF333333"/>
                                                </Path.Fill>
                                            </Path>
                                            <Rectangle x:Name="DisabledElement" Fill="#FFFFFFFF" Opacity="0" RadiusY="2" RadiusX="2"/>
                                        </Grid>
                                    </ControlTemplate>
                                    <ControlTemplate x:Key="VerticalIncrementTemplate" TargetType="RepeatButton">
                                        <Grid x:Name="Root">
                                            <VisualStateManager.VisualStateGroups>
                                                <VisualStateGroup x:Name="CommonStates">
                                                    <VisualState x:Name="Normal">
                                                        <Storyboard>
                                                            <DoubleAnimation Duration="0" To="90" Storyboard.TargetProperty="(Shape.Fill).(Brush.RelativeTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="BackgroundGradient" d:IsOptimized="True"/>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="MouseOver">
                                                        <Storyboard>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Background"/>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundGradient"/>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundMouseOver"/>
                                                            <ColorAnimation Duration="0" To="#7FFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#CCFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#F2FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Pressed">
                                                        <Storyboard>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Background"/>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundGradient"/>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundPressed"/>
                                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Highlight"/>
                                                            <ColorAnimation Duration="0" To="#6BFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#C6FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#EAFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#F4FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Disabled">
                                                        <Storyboard>
                                                            <DoubleAnimation Duration="0:0:0" To=".7" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledElement"/>
                                                        </Storyboard>
                                                    </VisualState>
                                                </VisualStateGroup>
                                            </VisualStateManager.VisualStateGroups>
                                            <Rectangle x:Name="Background" Fill="#FF1F3B53" Opacity="0" RadiusY="2" RadiusX="2" StrokeThickness="1">
                                                <Rectangle.Stroke>
                                                    <LinearGradientBrush EndPoint="1,.5" StartPoint="0,.5">
                                                        <GradientStop Color="#FF647480" Offset="1"/>
                                                        <GradientStop Color="#FFAEB7BF" Offset="0"/>
                                                        <GradientStop Color="#FF919EA7" Offset="0.35"/>
                                                        <GradientStop Color="#FF7A8A99" Offset="0.35"/>
                                                    </LinearGradientBrush>
                                                </Rectangle.Stroke>
                                            </Rectangle>
                                            <Rectangle x:Name="BackgroundMouseOver" Fill="#FF448DCA" Opacity="0" RadiusY="2" RadiusX="2" Stroke="#00000000" StrokeThickness="1"/>
                                            <Rectangle x:Name="BackgroundPressed" Fill="#FF448DCA" Opacity="0" RadiusY="2" RadiusX="2" Stroke="#00000000" StrokeThickness="1"/>
                                            <Rectangle x:Name="BackgroundGradient" Margin="1" Opacity="0" RadiusY="1" RadiusX="1" Stroke="#FFFFFFFF" StrokeThickness="1">
                                                <Rectangle.Fill>
                                                    <LinearGradientBrush EndPoint="1,.7" StartPoint="0,.7">
                                                        <GradientStop Color="#FFFFFFFF" Offset="0.013"/>
                                                        <GradientStop Color="#F9FFFFFF" Offset="0.375"/>
                                                        <GradientStop Color="#E5FFFFFF" Offset="0.603"/>
                                                        <GradientStop Color="#C6FFFFFF" Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Rectangle.Fill>
                                            </Rectangle>
                                            <Rectangle x:Name="Highlight" IsHitTestVisible="false" Margin="1" Opacity="0" RadiusY="1" RadiusX="1" Stroke="#FF6DBDD1" StrokeThickness="1"/>
                                            <Path Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z " Height="4" Stretch="Uniform" Width="8">
                                                <Path.Fill>
                                                    <SolidColorBrush x:Name="ButtonColor" Color="#FF333333"/>
                                                </Path.Fill>
                                            </Path>
                                            <Rectangle x:Name="DisabledElement" Fill="#FFFFFFFF" Opacity="0" RadiusY="2" RadiusX="2"/>
                                        </Grid>
                                    </ControlTemplate>
                                    <ControlTemplate x:Key="VerticalDecrementTemplate" TargetType="RepeatButton">
                                        <Grid x:Name="Root" Width="188" Height="20" Margin="-2,2,0,0">
                                            <VisualStateManager.VisualStateGroups>
                                                <VisualStateGroup x:Name="CommonStates">
                                                    <VisualState x:Name="Normal">
                                                        <Storyboard>
                                                            <DoubleAnimation Duration="0" To="90" Storyboard.TargetProperty="(Shape.Fill).(Brush.RelativeTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="BackgroundGradient" d:IsOptimized="True"/>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="MouseOver">
                                                        <Storyboard>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundGradient"/>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundMouseOver"/>
                                                            <ColorAnimation Duration="0" To="#FF4F97D5" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <DoubleAnimation Duration="0" To="90" Storyboard.TargetProperty="(Shape.Fill).(Brush.RelativeTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="BackgroundGradient" d:IsOptimized="True"/>
                                                            <ColorAnimation Duration="0" To="#FF81CDFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" d:IsOptimized="True"/>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Pressed">
                                                        <Storyboard>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundGradient"/>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundPressed"/>
                                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Highlight"/>
                                                            <ColorAnimation Duration="0" To="#FF4382B8" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#FF6DB7E7" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <DoubleAnimation Duration="0" To="90" Storyboard.TargetProperty="(Shape.Fill).(Brush.RelativeTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="BackgroundGradient" d:IsOptimized="True"/>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Disabled"/>
                                                </VisualStateGroup>
                                            </VisualStateManager.VisualStateGroups>
                                            <Rectangle Height="20" StrokeThickness="1" VerticalAlignment="Bottom" Width="188">
                                                <Rectangle.Fill>
                                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                        <LinearGradientBrush.RelativeTransform>
                                                            <CompositeTransform CenterY="0.5" CenterX="0.5"/>
                                                        </LinearGradientBrush.RelativeTransform>
                                                        <GradientStop Color="#FFB3E1FF" Offset="0"/>
                                                        <GradientStop Color="#FF65B6FC" Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Rectangle.Fill>
                                            </Rectangle>
                                            <Rectangle x:Name="BackgroundMouseOver" Fill="#FF448DCA" Opacity="0" Stroke="#00000000" StrokeThickness="1" Width="188" Height="20"/>
                                            <Rectangle x:Name="BackgroundPressed" Fill="#FF448DCA" Opacity="0" Stroke="#00000000" StrokeThickness="1" Width="188" Height="20"/>
                                            <Rectangle x:Name="BackgroundGradient" Margin="0" Opacity="0" Stroke="{x:Null}" StrokeThickness="1" Width="188" Height="20">
                                                <Rectangle.Fill>
                                                    <LinearGradientBrush EndPoint="1,.7" StartPoint="0,.7">
                                                        <LinearGradientBrush.RelativeTransform>
                                                            <CompositeTransform CenterY="0.5" CenterX="0.5"/>
                                                        </LinearGradientBrush.RelativeTransform>
                                                        <GradientStop Color="#FFB3E1FF" Offset="0.013"/>
                                                        <GradientStop Color="#FF65B6FC" Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Rectangle.Fill>
                                            </Rectangle>
                                            <Rectangle x:Name="Highlight" IsHitTestVisible="false" Margin="0" Opacity="0" StrokeThickness="1" Width="188" Height="20"/>
                                            <Path Data="F1 M7.9166671,6.7719998 L0.041666667,6.7719998 L3.9171028,9.8260671E-09 L7.9166671,6.7719998 z" Margin="91.958,4.77,88.125,8.458" UseLayoutRounding="False" HorizontalAlignment="Center" VerticalAlignment="Center">
                                                <Path.Fill>
                                                    <SolidColorBrush x:Name="ButtonColor" Color="White"/>
                                                </Path.Fill>
                                            </Path>
                                        </Grid>
                                    </ControlTemplate>
                                    <ControlTemplate x:Key="VerticalDecrementTemplate1" TargetType="RepeatButton">
                                        <Grid x:Name="Root" Width="188" Height="20" Margin="-3,2,0,0">
                                            <VisualStateManager.VisualStateGroups>
                                                <VisualStateGroup x:Name="CommonStates">
                                                    <VisualState x:Name="Normal">
                                                        <Storyboard>
                                                            <DoubleAnimation Duration="0" To="90" Storyboard.TargetProperty="(Shape.Fill).(Brush.RelativeTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="BackgroundGradient" d:IsOptimized="True"/>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="MouseOver">
                                                        <Storyboard>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundGradient"/>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundMouseOver"/>
                                                            <ColorAnimation Duration="0" To="#FF4F97D5" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <DoubleAnimation Duration="0" To="90" Storyboard.TargetProperty="(Shape.Fill).(Brush.RelativeTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="BackgroundGradient" d:IsOptimized="True"/>
                                                            <ColorAnimation Duration="0" To="#FF81CDFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" d:IsOptimized="True"/>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Pressed">
                                                        <Storyboard>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundGradient"/>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundPressed"/>
                                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Highlight"/>
                                                            <ColorAnimation Duration="0" To="#FF4382B8" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#FF6DB7E7" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <DoubleAnimation Duration="0" To="90" Storyboard.TargetProperty="(Shape.Fill).(Brush.RelativeTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="BackgroundGradient" d:IsOptimized="True"/>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Disabled"/>
                                                </VisualStateGroup>
                                            </VisualStateManager.VisualStateGroups>
                                            <Rectangle Height="20" StrokeThickness="1" VerticalAlignment="Bottom" Width="188">
                                                <Rectangle.Fill>
                                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                        <LinearGradientBrush.RelativeTransform>
                                                            <CompositeTransform CenterY="0.5" CenterX="0.5"/>
                                                        </LinearGradientBrush.RelativeTransform>
                                                        <GradientStop Color="#FFB3E1FF" Offset="0"/>
                                                        <GradientStop Color="#FF65B6FC" Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Rectangle.Fill>
                                            </Rectangle>
                                            <Rectangle x:Name="BackgroundMouseOver" Fill="#FF448DCA" Opacity="0" Stroke="#00000000" StrokeThickness="1" Width="188" Height="20"/>
                                            <Rectangle x:Name="BackgroundPressed" Fill="#FF448DCA" Opacity="0" Stroke="#00000000" StrokeThickness="1" Width="188" Height="20"/>
                                            <Rectangle x:Name="BackgroundGradient" Margin="0" Opacity="0" Stroke="{x:Null}" StrokeThickness="1" Width="188" Height="20">
                                                <Rectangle.Fill>
                                                    <LinearGradientBrush EndPoint="1,.7" StartPoint="0,.7">
                                                        <LinearGradientBrush.RelativeTransform>
                                                            <CompositeTransform CenterY="0.5" CenterX="0.5"/>
                                                        </LinearGradientBrush.RelativeTransform>
                                                        <GradientStop Color="#FFB3E1FF" Offset="0.013"/>
                                                        <GradientStop Color="#FF65B6FC" Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Rectangle.Fill>
                                            </Rectangle>
                                            <Rectangle x:Name="Highlight" IsHitTestVisible="false" Margin="0" Opacity="0" StrokeThickness="1" Width="188" Height="20"/>
                                            <Path Data="F1 M7.9166671,6.7719998 L0.041666667,6.7719998 L3.9171028,9.8260671E-09 L7.9166671,6.7719998 z" Margin="91.958,4.77,88.125,8.458" UseLayoutRounding="False" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
                                                <Path.RenderTransform>
                                                    <CompositeTransform Rotation="180"/>
                                                </Path.RenderTransform>
                                                <Path.Fill>
                                                    <SolidColorBrush x:Name="ButtonColor" Color="White"/>
                                                </Path.Fill>
                                            </Path>
                                        </Grid>
                                    </ControlTemplate>
                                    <ControlTemplate x:Key="VerticalThumbTemplate" TargetType="Thumb">
                                        <Grid>
                                            <VisualStateManager.VisualStateGroups>
                                                <VisualStateGroup x:Name="CommonStates">
                                                    <VisualState x:Name="Normal"/>
                                                    <VisualState x:Name="MouseOver">
                                                        <Storyboard>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundMouseOver"/>
                                                            <ColorAnimation Duration="0" To="#7FFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#CCFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#F2FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Pressed">
                                                        <Storyboard>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundPressed"/>
                                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Highlight"/>
                                                            <ColorAnimation Duration="0" To="#6BFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#C6FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#EAFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#F4FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Disabled">
                                                        <Storyboard>
                                                            <DoubleAnimation Duration="0:0:0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ThumbVisual"/>
                                                        </Storyboard>
                                                    </VisualState>
                                                </VisualStateGroup>
                                            </VisualStateManager.VisualStateGroups>
                                            <Grid x:Name="ThumbVisual" Margin="1,0,1,0">
                                                <Rectangle x:Name="Background" Fill="#FF1F3B53" RadiusY="2" RadiusX="2" StrokeThickness="1">
                                                    <Rectangle.Stroke>
                                                        <LinearGradientBrush EndPoint="1,.5" StartPoint="0,.5">
                                                            <GradientStop Color="#FF818F99" Offset="1"/>
                                                            <GradientStop Color="#FFC2C9CE" Offset="0"/>
                                                            <GradientStop Color="#FFB3BBC1" Offset="0.35"/>
                                                            <GradientStop Color="#FF96A4B1" Offset="0.35"/>
                                                        </LinearGradientBrush>
                                                    </Rectangle.Stroke>
                                                </Rectangle>
                                                <Rectangle x:Name="BackgroundMouseOver" Fill="#FF448DCA" Opacity="0" RadiusY="2" RadiusX="2" Stroke="#00000000" StrokeThickness="1"/>
                                                <Rectangle x:Name="BackgroundPressed" Fill="#FF448DCA" Opacity="0" RadiusY="2" RadiusX="2" Stroke="#00000000" StrokeThickness="1"/>
                                                <Rectangle x:Name="BackgroundGradient" Margin="1" RadiusY="1" RadiusX="1" Stroke="#FFFFFFFF" StrokeThickness="1">
                                                    <Rectangle.Fill>
                                                        <LinearGradientBrush EndPoint="1,.7" StartPoint="0,.7">
                                                            <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                                            <GradientStop Color="#F9FFFFFF" Offset="0.375"/>
                                                            <GradientStop Color="#E5FFFFFF" Offset="0.6"/>
                                                            <GradientStop Color="#C6FFFFFF" Offset="1"/>
                                                        </LinearGradientBrush>
                                                    </Rectangle.Fill>
                                                </Rectangle>
                                                <Rectangle x:Name="Highlight" IsHitTestVisible="false" Margin="1" Opacity="0" RadiusY="1" RadiusX="1" Stroke="#FF6DBDD1" StrokeThickness="1"/>
                                            </Grid>
                                        </Grid>
                                    </ControlTemplate>
                                    <ControlTemplate x:Key="HorizontalThumbTemplate" TargetType="Thumb">
                                        <Grid>
                                            <VisualStateManager.VisualStateGroups>
                                                <VisualStateGroup x:Name="CommonStates">
                                                    <VisualState x:Name="Normal"/>
                                                    <VisualState x:Name="MouseOver">
                                                        <Storyboard>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundMouseOver"/>
                                                            <ColorAnimation Duration="0" To="#7FFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#CCFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#F2FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Pressed">
                                                        <Storyboard>
                                                            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundPressed"/>
                                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Highlight"/>
                                                            <ColorAnimation Duration="0" To="#6BFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#C6FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#EAFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                            <ColorAnimation Duration="0" To="#F4FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Disabled">
                                                        <Storyboard>
                                                            <DoubleAnimation Duration="0:0:0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ThumbVisual"/>
                                                        </Storyboard>
                                                    </VisualState>
                                                </VisualStateGroup>
                                            </VisualStateManager.VisualStateGroups>
                                            <Grid x:Name="ThumbVisual" Margin="0,1,0,1">
                                                <Rectangle x:Name="Background" Fill="#FF1F3B53" RadiusY="2" RadiusX="2" StrokeThickness="1">
                                                    <Rectangle.Stroke>
                                                        <LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0">
                                                            <GradientStop Color="#FF818F99" Offset="1"/>
                                                            <GradientStop Color="#FFC2C9CE" Offset="0"/>
                                                            <GradientStop Color="#FFB3BBC1" Offset="0.35"/>
                                                            <GradientStop Color="#FF96A4B1" Offset="0.35"/>
                                                        </LinearGradientBrush>
                                                    </Rectangle.Stroke>
                                                </Rectangle>
                                                <Rectangle x:Name="BackgroundMouseOver" Fill="#FF448DCA" Opacity="0" RadiusY="2" RadiusX="2" Stroke="#00000000" StrokeThickness="1"/>
                                                <Rectangle x:Name="BackgroundPressed" Fill="#FF448DCA" Opacity="0" RadiusY="2" RadiusX="2" Stroke="#00000000" StrokeThickness="1"/>
                                                <Rectangle x:Name="BackgroundGradient" Margin="1" RadiusY="1" RadiusX="1" Stroke="#FFFFFFFF" StrokeThickness="1">
                                                    <Rectangle.Fill>
                                                        <LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
                                                            <GradientStop Color="#FFFFFFFF" Offset="0.013"/>
                                                            <GradientStop Color="#F9FFFFFF" Offset="0.375"/>
                                                            <GradientStop Color="#E5FFFFFF" Offset="0.603"/>
                                                            <GradientStop Color="#C6FFFFFF" Offset="1"/>
                                                        </LinearGradientBrush>
                                                    </Rectangle.Fill>
                                                </Rectangle>
                                                <Rectangle x:Name="Highlight" IsHitTestVisible="false" Margin="1" Opacity="0" RadiusY="1" RadiusX="1" Stroke="#FF6DBDD1" StrokeThickness="1"/>
                                            </Grid>
                                        </Grid>
                                    </ControlTemplate>
                                </Grid.Resources>
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="CommonStates">
                                        <VisualState x:Name="Normal"/>
                                        <VisualState x:Name="MouseOver"/>
                                        <VisualState x:Name="Disabled">
                                            <Storyboard>
                                                <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root"/>
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                                <Grid x:Name="VerticalRoot" Visibility="Collapsed" Width="188" Margin="-1,0">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition/>
                                        <RowDefinition Height="Auto" MinHeight="22"/>
                                    </Grid.RowDefinitions>
                                    <RepeatButton x:Name="VerticalSmallDecrease" Height="20" IsTabStop="False" Interval="50" Margin="-0.5,-1,0.5,0" Grid.Row="0" Template="{StaticResource VerticalDecrementTemplate}" Width="188"/>
                                    <RepeatButton x:Name="VerticalSmallIncrease" Height="20" IsTabStop="False" Interval="50" Margin="2,1" Grid.Row="4" Template="{StaticResource VerticalDecrementTemplate1}" Width="184"/>
                                </Grid>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <!-- ScrollViewerStyleBlue. -->

            <Style x:Key="ScrollViewerStyleBlue" TargetType="ScrollViewer">
                <Setter Property="HorizontalContentAlignment" Value="Left"/>
                <Setter Property="VerticalContentAlignment" Value="Top"/>
                <Setter Property="VerticalScrollBarVisibility" Value="Visible"/>
                <Setter Property="Padding" Value="4"/>
                <Setter Property="BorderThickness" Value="1"/>
                <Setter Property="BorderBrush">
                    <Setter.Value>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFA3AEB9" Offset="0"/>
                            <GradientStop Color="#FF8399A9" Offset="0.375"/>
                            <GradientStop Color="#FF718597" Offset="0.375"/>
                            <GradientStop Color="#FF617584" Offset="1"/>
                        </LinearGradientBrush>
                    </Setter.Value>
                </Setter>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ScrollViewer">
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2">
                                <Grid Background="{TemplateBinding Background}">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="*"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <ScrollContentPresenter x:Name="ScrollContentPresenter" Cursor="{TemplateBinding Cursor}" ContentTemplate="{TemplateBinding ContentTemplate}" Margin="{TemplateBinding Padding}"/>
                                    <Rectangle Grid.Column="1" Fill="#FFE9EEF4" Grid.Row="1"/>
                                    <ScrollBar x:Name="VerticalScrollBar" IsTabStop="False" Maximum="{TemplateBinding ScrollableHeight}" Margin="1,-1,-1,-1" Minimum="0" Orientation="Vertical" Grid.Row="0" Visibility="{Binding Visibility, RelativeSource={RelativeSource TemplatedParent}}" Value="{TemplateBinding VerticalOffset}" ViewportSize="{TemplateBinding ViewportHeight}" Grid.ColumnSpan="2" Grid.RowSpan="2" Style="{StaticResource ScrollBarStyleBlue}"/>
                                </Grid>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <!-- ListBoxStyleBlue. -->

            <Style x:Key="ListBoxStyleBlue" TargetType="ListBox">
                <Setter Property="Padding" Value="1"/>
                <Setter Property="Background" Value="#FFFFFFFF"/>
                <Setter Property="Foreground" Value="#FF000000"/>
                <Setter Property="HorizontalContentAlignment" Value="Left"/>
                <Setter Property="VerticalContentAlignment" Value="Top"/>
                <Setter Property="IsTabStop" Value="False"/>
                <Setter Property="BorderThickness" Value="1"/>
                <Setter Property="TabNavigation" Value="Once"/>
                <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
                <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
                <Setter Property="BorderBrush">
                    <Setter.Value>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFA3AEB9" Offset="0"/>
                            <GradientStop Color="#FF8399A9" Offset="0.375"/>
                            <GradientStop Color="#FF718597" Offset="0.375"/>
                            <GradientStop Color="#FF617584" Offset="1"/>
                        </LinearGradientBrush>
                    </Setter.Value>
                </Setter>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ListBox">
                            <Grid>
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="ValidationStates">
                                        <VisualState x:Name="Valid"/>
                                        <VisualState x:Name="InvalidUnfocused">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ValidationErrorElement">
                                                    <DiscreteObjectKeyFrame KeyTime="0">
                                                        <DiscreteObjectKeyFrame.Value>
                                                            <Visibility>Visible</Visibility>
                                                        </DiscreteObjectKeyFrame.Value>
                                                    </DiscreteObjectKeyFrame>
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="InvalidFocused">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ValidationErrorElement">
                                                    <DiscreteObjectKeyFrame KeyTime="0">
                                                        <DiscreteObjectKeyFrame.Value>
                                                            <Visibility>Visible</Visibility>
                                                        </DiscreteObjectKeyFrame.Value>
                                                    </DiscreteObjectKeyFrame>
                                                </ObjectAnimationUsingKeyFrames>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsOpen" Storyboard.TargetName="validationTooltip">
                                                    <DiscreteObjectKeyFrame KeyTime="0">
                                                        <DiscreteObjectKeyFrame.Value>
                                                            <System:Boolean>True</System:Boolean>
                                                        </DiscreteObjectKeyFrame.Value>
                                                    </DiscreteObjectKeyFrame>
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                                <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                                    <ScrollViewer x:Name="ScrollViewer" BorderBrush="Transparent" BorderThickness="0" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" TabNavigation="{TemplateBinding TabNavigation}" Style="{StaticResource ScrollViewerStyleBlue}" Width="188">
                                        <ItemsPresenter Width="188" Margin="-2,17,0,18"/>
                                    </ScrollViewer>
                                </Border>
                                <Border x:Name="ValidationErrorElement" BorderBrush="#FFDB000C" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2" Visibility="Collapsed">
                                    <ToolTipService.ToolTip>
                                        <ToolTip x:Name="validationTooltip" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Template="{StaticResource ValidationToolTipTemplate}">
                                            <ToolTip.Triggers>
                                                <EventTrigger RoutedEvent="Canvas.Loaded">
                                                    <BeginStoryboard>
                                                        <Storyboard>
                                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible" Storyboard.TargetName="validationTooltip">
                                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                                    <DiscreteObjectKeyFrame.Value>
                                                                        <System:Boolean>true</System:Boolean>
                                                                    </DiscreteObjectKeyFrame.Value>
                                                                </DiscreteObjectKeyFrame>
                                                            </ObjectAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </BeginStoryboard>
                                                </EventTrigger>
                                            </ToolTip.Triggers>
                                        </ToolTip>
                                    </ToolTipService.ToolTip>
                                    <Grid Background="Transparent" HorizontalAlignment="Right" Height="10" Margin="0,-4,-4,0" VerticalAlignment="Top" Width="10">
                                        <Path Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z" Fill="#FFDC000C" Margin="-1,3,0,0"/>
                                        <Path Data="M 0,0 L2,0 L 8,6 L8,8" Fill="#ffffff" Margin="-1,3,0,0"/>
                                    </Grid>
                                </Border>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <!-- ItemContainerStyleSmall -->

            <Style xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows" x:Key="ListBoxItemStyleSmall" TargetType="ListBoxItem">
                <Setter Property="Foreground" Value="#FF000000" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ListBoxItem">
                            <Grid x:Name="RootElement">
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="CommonStates">
                                        <VisualState x:Name="Normal">

                                        </VisualState>
                                        <VisualState x:Name="MouseOver" >

                                            <Storyboard>
                                                <ColorAnimation Duration="0" To="#FF99DFF5" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                <ColorAnimation Duration="0" To="#FF99DFF5" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                <ColorAnimation Duration="0" To="#FF02B0E6" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                <ColorAnimation Duration="0" To="#FF02B0E6" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>

                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Disabled" />
                                    </VisualStateGroup>

                                    <VisualStateGroup x:Name="FocusStates">

                                        <VisualState x:Name="Focused">

                                        </VisualState>

                                        <VisualState x:Name="Unfocused">

                                        </VisualState>
                                    </VisualStateGroup>

                                    <VisualStateGroup x:Name="SelectionStates">

                                        <VisualStateGroup.Transitions>
                                            <VisualTransition To="Unselected">

                                            </VisualTransition>

                                            <VisualTransition To="Selected">
                                                <Storyboard>
                                                    <ColorAnimation Duration="0" To="#FF75CCE7" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradientInner"/>
                                                    <ColorAnimation Duration="0" To="#FF75CCE7" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradientInner"/>
                                                    <ColorAnimation Duration="0" To="#FF009DCE" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradientInner"/>
                                                    <ColorAnimation Duration="0" To="#FF009DCE" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradientInner"/>
                                                </Storyboard>
                                            </VisualTransition>
                                        </VisualStateGroup.Transitions>
                                        <VisualState x:Name="Selected">
                                            <Storyboard>
                                                <ColorAnimation Duration="0" To="#FF75CCE7" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradientInner"/>
                                                <ColorAnimation Duration="0" To="#FF75CCE7" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradientInner"/>
                                                <ColorAnimation Duration="0" To="#FF009DCE" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradientInner"/>
                                                <ColorAnimation Duration="0" To="#FF009DCE" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradientInner"/>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Unselected">

                                        </VisualState>

                                        <VisualState x:Name="SelectedUnfocused">
                                            <Storyboard>
                                                <ColorAnimation Duration="0" To="#FF75CCE7" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradientInner"/>
                                                <ColorAnimation Duration="0" To="#FF75CCE7" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradientInner"/>
                                                <ColorAnimation Duration="0" To="#FF009DCE" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradientInner"/>
                                                <ColorAnimation Duration="0" To="#FF009DCE" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradientInner"/>
                                            </Storyboard>
                                        </VisualState>

                                    </VisualStateGroup>

                                </VisualStateManager.VisualStateGroups>

                                <Border x:Name="BackgroundGradient"   BorderThickness="1" BorderBrush="{StaticResource BorderBrush}"   Height="33" Margin="0,0,0,0" Padding="0" Width="186">
                                    <Border.Background>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#ebf2f6" Offset="0"/>
                                            <GradientStop Color="#ebf2f6" Offset=".01"/>
                                            <GradientStop Color="#c8e0f1" Offset=".99"/>
                                            <GradientStop Color="#c8e0f1" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Border.Background>
                                    <Border x:Name="BackgroundGradientInner"   BorderBrush="{StaticResource BorderBrush}"   Height="33" Padding="0" Width="186">
                                        <Border.Background>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                <GradientStop Color="Transparent" Offset="0"/>
                                                <GradientStop Color="Transparent" Offset=".01"/>
                                                <GradientStop Color="Transparent" Offset=".99"/>
                                                <GradientStop Color="Transparent" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Border.Background>
                                        <StackPanel x:Name="spRoot" Orientation="Horizontal">
                                            <StackPanel Margin="0,2,0,0" Orientation="Horizontal">
                                                <TextBlock x:Name="tbClientName" FontSize="10" FontWeight="Bold" Margin="4,6,0,2" MinWidth="65" MaxWidth="70" Text="{Binding RefId}" Foreground="{StaticResource FontColour}" />
                                                <StackPanel Orientation="Horizontal" Margin="0,-4,0,0">
                                                    <StackPanel Orientation="Horizontal" Margin="4,0,0,0">
                                                        <Grid Margin="0,2,0,0">
                                                            <Grid.ColumnDefinitions>
                                                                <ColumnDefinition Width="30"/>
                                                                <ColumnDefinition Width="18" />
                                                            </Grid.ColumnDefinitions>
                                                            <Image Source="Images/bg.png" Grid.Column="0" Grid.ColumnSpan="2"  Height="21" />
                                                            <Image Source="Images/car.png" Grid.Column="0" Grid.ColumnSpan="1"   Height="17" />
                                                            <TextBlock Foreground="{StaticResource FontColour}"   Margin="0,9,0,0" Text="{Binding VehicleCount}" Grid.Column="1" Grid.ColumnSpan="1"/>
                                                        </Grid>
                                                    </StackPanel>
                                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="4,0,0,0">
                                                        <Grid Margin="0,2,0,0">
                                                            <Grid.ColumnDefinitions>
                                                                <ColumnDefinition Width="30"/>
                                                                <ColumnDefinition Width="18" />
                                                            </Grid.ColumnDefinitions>
                                                            <Image Source="Images/bg.png" Grid.Column="0" Grid.ColumnSpan="2"  Height="21" />
                                                            <Image Source="{Binding SeveriotyImg.Source}"  Grid.Column="0" Grid.ColumnSpan="1"   Height="17" />
                                                            <TextBlock Foreground="{StaticResource FontColour}"  Margin="0,9,0,0" Text="{Binding CasualityCount}"  Grid.Column="1" Grid.ColumnSpan="1"/>
                                                        </Grid>
                                                    </StackPanel>
                                                </StackPanel>
                                            </StackPanel>
                                        </StackPanel>
                                    </Border>
                                </Border>
                                <Rectangle x:Name="FocusRectangle" Stroke="Black" StrokeDashArray="1,2" Visibility="Collapsed" IsHitTestVisible="False" Margin="1,1,1,1"/>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <!-- ItemContainerStyleLarge -->
            
            <Style xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows" x:Key="ListBoxItemStyleLarge" TargetType="ListBoxItem">
                <Setter Property="Foreground" Value="#FF000000" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ListBoxItem">
                            <Grid x:Name="RootElement" Background="AntiqueWhite" Height="60">
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="CommonStates">
                                        <VisualState x:Name="Normal">

                                        </VisualState>
                                        <VisualState x:Name="MouseOver" >
                                            <Storyboard>
                                                <ColorAnimation Duration="0" To="#FF99DFF5" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                <ColorAnimation Duration="0" To="#FF99DFF5" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                <ColorAnimation Duration="0" To="#FF02B0E6" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                                <ColorAnimation Duration="0" To="#FF02B0E6" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Disabled" />
                                    </VisualStateGroup>

                                    <VisualStateGroup x:Name="FocusStates">
                                        <VisualState x:Name="Focused">
                                        </VisualState>
                                        <VisualState x:Name="Unfocused">
                                        </VisualState>
                                    </VisualStateGroup>

                                    <VisualStateGroup x:Name="SelectionStates">
                                        <VisualStateGroup.Transitions>
                                            <VisualTransition To="Unselected">
                                            </VisualTransition>
                                            <VisualTransition To="Selected">
                                                <Storyboard>
                                                    <ColorAnimation Duration="0" To="#FF75CCE7" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradientInner"/>
                                                    <ColorAnimation Duration="0" To="#FF75CCE7" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradientInner"/>
                                                    <ColorAnimation Duration="0" To="#FF009DCE" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradientInner"/>
                                                    <ColorAnimation Duration="0" To="#FF009DCE" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradientInner"/>
                                                </Storyboard>
                                            </VisualTransition>
                                        </VisualStateGroup.Transitions>
                                        <VisualState x:Name="Selected">
                                            <Storyboard>
                                                <ColorAnimation Duration="0" To="#FF75CCE7" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradientInner"/>
                                                <ColorAnimation Duration="0" To="#FF75CCE7" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradientInner"/>
                                                <ColorAnimation Duration="0" To="#FF009DCE" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradientInner"/>
                                                <ColorAnimation Duration="0" To="#FF009DCE" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradientInner"/>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Unselected">

                                        </VisualState>

                                        <VisualState x:Name="SelectedUnfocused">
                                            <Storyboard>
                                                <ColorAnimation Duration="0" To="#FF75CCE7" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradientInner"/>
                                                <ColorAnimation Duration="0" To="#FF75CCE7" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradientInner"/>
                                                <ColorAnimation Duration="0" To="#FF009DCE" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradientInner"/>
                                                <ColorAnimation Duration="0" To="#FF009DCE" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradientInner"/>
                                            </Storyboard>
                                        </VisualState>

                                    </VisualStateGroup>

                                </VisualStateManager.VisualStateGroups>



                                <Border x:Name="BackgroundGradient"  BorderThickness="1" BorderBrush="{StaticResource BorderBrush}"  Margin="0,0,0,0"  Padding="0" Width="186">
                                    <Border.Background>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#ebf2f6" Offset="0"/>
                                            <GradientStop Color="#ebf2f6" Offset=".01"/>
                                            <GradientStop Color="#c8e0f1" Offset=".99"/>
                                            <GradientStop Color="#c8e0f1" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Border.Background>
                                    <Border x:Name="BackgroundGradientInner"  BorderBrush="{StaticResource BorderBrush}"   Padding="0" Width="186">
                                        <Border.Background>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                <GradientStop Color="Transparent" Offset="0"/>
                                                <GradientStop Color="Transparent" Offset=".01"/>
                                                <GradientStop Color="Transparent" Offset=".99"/>
                                                <GradientStop Color="Transparent" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Border.Background>

                                        <StackPanel x:Name="spRoot" Orientation="Horizontal">
                                            <StackPanel>
                                                <Rectangle Stretch="Fill"  Height="70" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Fill="{Binding Path=SeveriotyRec.Fill}" Width="10"></Rectangle>
                                            </StackPanel>
                                            <StackPanel Margin="2,0,0,0" Orientation="Vertical">
                                                <StackPanel Orientation="Horizontal">
                                                    <TextBlock  Foreground="{StaticResource FontColour}" FontSize="13" FontWeight="Bold" Margin="45,3,0,2" Text="{Binding RefId}" />
                                                </StackPanel>
                                                <StackPanel Orientation="Horizontal" Margin="2,2,0,0">
                                                    <StackPanel Orientation="Horizontal" Margin="0,0,4,0">
                                                        <TextBlock Foreground="{StaticResource FontColour}" Text="{Binding Vehicle}"  Margin="10,0,0,0"/>
                                                        <!--Text="Vehicles:"-->
                                                        <TextBlock  Foreground="{StaticResource FontColour}"  Text="{Binding VehicleCount}"/>
                                                        <!--VehicleCountk__BackingField-->
                                                    </StackPanel>
                                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="3,0,0,0">
                                                        <TextBlock Foreground="{StaticResource FontColour}"  Text="{Binding Casualties}"/>
                                                        <!--Text="Casualties:"-->
                                                        <TextBlock Foreground="{StaticResource FontColour}"  Text="{Binding CasualityCount}"/>
                                                    </StackPanel>
                                                </StackPanel>
                                            </StackPanel>
                                        </StackPanel>
                                    </Border>
                                </Border>
                                <Rectangle x:Name="FocusRectangle" Stroke="Black" StrokeDashArray="1,2" Visibility="Collapsed" IsHitTestVisible="False" Margin="1,1,1,1"/>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

        </UserControl.Resources>


    i set this as the default style  in dll.

    <ListBox x:Name="lbAccidents" Margin="0,3,0,0" Style="{StaticResource ListBoxStyleBlue}"  ItemContainerStyle="{StaticResource ListBoxItemStyleSmall}"   Grid.Row="1"  VerticalAlignment="Top" MinHeight="458" MaxHeight="540" SelectionChanged="lbAccidents_SelectionChanged">
            </ListBox>


    my property is


    #region Properties

            // Style Property for ListPanel
            public Style ListPanelStyle                     
            {
                get
                {
                    return lbAccidents.Style as Style;
                }

                set
                {
                    lbAccidents.Style = ListPanelStyle;
                }
            }

            // ItemContainerStyle Property for ListPanel
            public Style ListPanelItemContainerStyle        
            {
                get
                {
                    return lbAccidents.ItemContainerStyle as Style;
                }

                set
                {
                    lbAccidents.ItemContainerStyle = ListPanelItemContainerStyle;
                }
            }    

            // Background Property for Accident Display Panel
            public Brush AccidentDisplayBackground
            {
                get
                {
                    return spAccidentDisplay.Background;
                }

                set
                {
                    spAccidentDisplay.Background = AccidentDisplayBackground;
                }
            }

            // Foregound Property for Accident Display Panel
            public Brush AccidentDisplayForeground
            {
                get
                {
                    return tbkCountDisplay.Foreground;
                }

                set
                {
                    tbkCountDisplay.Foreground = AccidentDisplayForeground;
                    tbkCountTotal.Foreground = AccidentDisplayForeground;
                    tbkOf.Foreground = AccidentDisplayForeground;
                    tbkShowing.Foreground = AccidentDisplayForeground;
                }
            }

            // Maximum Height Property for ListPanel
            public double ListPanelMaxHeight
            {
                get
                {
                    return lbAccidents.MaxHeight;
                }
                set
                {
                    lbAccidents.MaxHeight = ListPanelMaxHeight;
                }
            }

            // Minimum Height Property for ListPanel
            public double ListPanelMinHeight
            {
                get
                {
                    return lbAccidents.MinHeight;
                }
                set
                {
                    lbAccidents.MinHeight = ListPanelMinHeight;
                }

            }

            // Width Property ListPanel
            public double ListPanelWidth
            {
                get
                {
                    return lbAccidents.Width;
                }
                set
                {
                    lbAccidents.Width = ListPanelWidth;
                }
            }

            // Selected Item Property for ListPanel
            public Accident SelectedItem
            {
                get
                {
                    return (Accident)lbAccidents.SelectedItem;
                }
                set
                {
                    lbAccidents.SelectedItem = SelectedItem;
                }
            }

            // Currently Selected Index Property for ListPanel
            public int SelectionIndex
            {
                get
                {
                    return lbAccidents.SelectedIndex;
                }
                set
                {
                    lbAccidents.SelectedIndex = SelectionIndex;
                }
            }

            // Property that gets or sets the value for RefId
            public string RefId
            {
                get;
                set;
            }       

            #endregion



    i tested this in test project by

    <ListPanel x:name="TestList" style="{StaticResource ListBoxStyleBluenew}"/>

    i did not get any error. but style didnot reset..... plz help


    Thanks

    sen

    Friday, November 12, 2010 4:59 AM

All replies

  • Hi,

    What's your issue going now?

    Tuesday, November 16, 2010 3:39 AM
  • try it by adding basedon in your style

       
    <Style TargetType="local:YourControl"

               BasedOn="{StaticResource Style_Key}">

       
    </Style>

     

    Wednesday, February 29, 2012 5:52 AM