<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="StockPortfolio.GridArea" mc:Ignorable="d" d:DesignHeight="504" d:DesignWidth="866" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows" xmlns:system="clr-namespace:System;assembly=mscorlib" xmlns:System_Windows_Controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:StockPortfolio="clr-namespace:StockPortfolio">
    <UserControl.Resources>
        <!--<Storyboard x:Name="ShowDisableGrid">
            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisableGrid" Storyboard.TargetProperty="Visibility">
                <DiscreteObjectKeyFrame KeyTime="0">
                    <DiscreteObjectKeyFrame.Value>
                        <Visibility>Visible</Visibility>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisableGrid" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.5" Value="0.5"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="HideDisableGrid">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisableGrid" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.5"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.5" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisableGrid" Storyboard.TargetProperty="Visibility" BeginTime="00:00:00.5">
                <DiscreteObjectKeyFrame KeyTime="0">
                    <DiscreteObjectKeyFrame.Value>
                        <Visibility>Collapsed</Visibility>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>-->

        <Style x:Key="btnChartStyle" TargetType="Button">
            <Setter Property="IsEnabled" Value="true" />
            <Setter Property="IsTabStop" Value="true" />
            <Setter Property="Cursor" Value="Hand" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid x:Name="delete" RenderTransformOrigin="0.5,0.5" Visibility="Visible" Background="{TemplateBinding Background}">
                            <vsm:VisualStateManager.VisualStateGroups>
                                <vsm:VisualStateGroup x:Name="CommonStates">
                                    <vsm:VisualStateGroup.Transitions>
                                        <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver" />
                                        <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed" />
                                    </vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualState x:Name="Normal" />
                                    <vsm:VisualState x:Name="MouseOver" />
                                    <vsm:VisualState x:Name="Pressed" />
                                    <vsm:VisualState x:Name="Disabled" />
                                </vsm:VisualStateGroup>
                                <vsm:VisualStateGroup x:Name="FocusStates">
                                    <vsm:VisualState x:Name="Focused" />
                                    <vsm:VisualState x:Name="Unfocused" />
                                </vsm:VisualStateGroup>
                            </vsm:VisualStateManager.VisualStateGroups>

                            <!--<Grid.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="1.25" ScaleY="1.25"/>
                                    <SkewTransform AngleX="0" AngleY="0"/>
                                    <RotateTransform Angle="0"/>
                                    <TranslateTransform X="0" Y="0"/>
                                </TransformGroup>
                            </Grid.RenderTransform>-->

                            <StockPortfolio:ChartIcon Width="20" Height="20" HorizontalAlignment="Center" VerticalAlignment="Center" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="btnDeleteStyle" TargetType="Button">
            <Setter Property="IsEnabled" Value="true" />
            <Setter Property="IsTabStop" Value="true" />
            <Setter Property="Cursor" Value="Hand" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Height="20.197" x:Name="delete" Width="19.652" RenderTransformOrigin="0.5,0.5" Visibility="Visible">
                            <vsm:VisualStateManager.VisualStateGroups>
                                <vsm:VisualStateGroup x:Name="CommonStates">
                                    <vsm:VisualStateGroup.Transitions>
                                        <vsm:VisualTransition GeneratedDuration="0:0:0.2" To="MouseOver" />
                                        <vsm:VisualTransition GeneratedDuration="0:0:0.1" To="Pressed" />
                                    </vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualState x:Name="Normal" />
                                    <vsm:VisualState x:Name="MouseOver">
                                        <Storyboard />
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Pressed">
                                        <Storyboard />
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Disabled">
                                        <Storyboard />
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                                <vsm:VisualStateGroup x:Name="FocusStates">
                                    <vsm:VisualState x:Name="Focused">
                                        <Storyboard />
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Unfocused">
                                        <Storyboard />
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                            </vsm:VisualStateManager.VisualStateGroups>

                            <Grid.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="1.25" ScaleY="1.25" />
                                    <SkewTransform AngleX="0" AngleY="0" />
                                    <RotateTransform Angle="0" />
                                    <TranslateTransform X="0" Y="0" />
                                </TransformGroup>
                            </Grid.RenderTransform>

                            <StockPortfolio:DeleteIcon />

                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <ControlTemplate x:Key="C1DataGridTemplate" TargetType="c1:C1DataGrid">
            <Grid x:Name="Root">
                <vsm:VisualStateManager.VisualStateGroups>
                    <vsm:VisualStateGroup x:Name="CommonStates">
                        <vsm:VisualState x:Name="Normal" />
                        <vsm:VisualState x:Name="MouseOver">
                            <Storyboard />
                        </vsm:VisualState>
                        <vsm:VisualState x:Name="Disabled">
                            <Storyboard>
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                                    <SplineDoubleKeyFrame KeyTime="0" Value=".7" />
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                        </vsm:VisualState>
                        <vsm:VisualState x:Name="ReadOnly">
                            <Storyboard />
                        </vsm:VisualState>
                    </vsm:VisualStateGroup>
                    <vsm:VisualStateGroup x:Name="LoadingStates">
                        <vsm:VisualStateGroup.Transitions>
                            <vsm:VisualTransition To="Loading" GeneratedDuration="0:0:0.2" />
                        </vsm:VisualStateGroup.Transitions>
                        <vsm:VisualState x:Name="Ready" />
                        <vsm:VisualState x:Name="Loading">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LoadingBackground" Storyboard.TargetProperty="IsHitTestVisible">
                                    <DiscreteObjectKeyFrame KeyTime="0">
                                        <DiscreteObjectKeyFrame.Value>
                                            <system:Boolean>True</system:Boolean>
                                        </DiscreteObjectKeyFrame.Value>
                                    </DiscreteObjectKeyFrame>
                                </ObjectAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="LoadingBackground" Storyboard.TargetProperty="(UIElement.Opacity)">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                                </DoubleAnimationUsingKeyFrames>
                                <Storyboard RepeatBehavior="Forever">
                                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="path" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
                                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
                                        <SplineDoubleKeyFrame KeyTime="00:00:00.65" Value="360" />
                                    </DoubleAnimationUsingKeyFrames>
                                </Storyboard>
                            </Storyboard>
                        </vsm:VisualState>
                    </vsm:VisualStateGroup>
                </vsm:VisualStateManager.VisualStateGroups>
                <Grid.Resources>
                    <ControlTemplate x:Key="TopLeftHeaderTemplate" TargetType="c1:DataGridColumnHeaderPresenter">
                        <Grid x:Name="RootElement">
                            <Grid.Background>
                                <LinearGradientBrush StartPoint="0,0" EndPoint="0.958000004291534,0.896000027656555">
                                    <GradientStop Color="#FFFDFDFD" Offset="0" />
                                    <GradientStop x:Name="StopColor4" Color="#FFCDDDE4" Offset="0.754" />
                                </LinearGradientBrush>
                            </Grid.Background>

                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>

                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>

                            <!--<Line Stretch="Fill" Grid.RowSpan="2" X1="0" X2="0" Y1="0" Y2="1" StrokeThickness="1" Stroke="{TemplateBinding SeparatorBrush}" Visibility="{TemplateBinding SeparatorVisibility}"/>-->
                            <Rectangle Stretch="Fill" StrokeThickness="1" Grid.RowSpan="2" Grid.ColumnSpan="2" Margin="0,0,0,0">
                                <Rectangle.Stroke>
                                    <LinearGradientBrush EndPoint="0.00400000018998981,0.718999981880188" StartPoint="0.980000019073486,0.71399998664856">
                                        <GradientStop Color="#FFDFE7EA" Offset="0.089" />
                                        <GradientStop Color="#FFF1F4F5" Offset="1" />
                                        <GradientStop Color="#FFC6D5DE" Offset="0" />
                                    </LinearGradientBrush>
                                </Rectangle.Stroke>
                            </Rectangle>

                            <Line Stretch="Fill" Grid.Column="1" Grid.RowSpan="2" X1="0" X2="0" Y1="0" Y2="1" StrokeThickness="1" Stroke="#FFA1BAC8" Margin="0,-0.5,0,-0.5" />
                            <Line Stretch="Fill" Grid.ColumnSpan="2" Grid.Row="2" X1="0" X2="1" Y1="0" Y2="0" StrokeThickness="1" Margin="-0.5,0,-0.5,0">
                                <Line.Stroke>
                                    <LinearGradientBrush EndPoint="0.0140000004321337,0.75" StartPoint="0.987999975681305,0.916999995708466">
                                        <GradientStop Color="#FFB2C1CA" Offset="0.464" />
                                        <GradientStop Color="#FFDBE2E5" Offset="0.634" />
                                    </LinearGradientBrush>
                                </Line.Stroke>
                            </Line>
                            <!--<Line Stretch="Fill" Grid.RowSpan="2" X1="0" X2="0" Y1="0" Y2="1" StrokeThickness="1" Stroke="{TemplateBinding SeparatorBrush}" Visibility="{TemplateBinding SeparatorVisibility}"/>-->
                        </Grid>
                    </ControlTemplate>
                </Grid.Resources>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <!-- scrollbars -->
                <ScrollBar x:Name="HorizontalScrollBar" Grid.ColumnSpan="2" Grid.Row="2" Height="20" Orientation="Horizontal" Visibility="Collapsed" />
                <ScrollBar x:Name="VerticalScrollBar" Grid.RowSpan="2" Grid.Column="2" Width="20" Orientation="Vertical" Visibility="Collapsed" />

                <!-- corners -->
                <c1:DataGridColumnHeaderPresenter Name="TopLeftCornerHeaderElement" Template="{StaticResource TopLeftHeaderTemplate}" />
                <Rectangle x:Name="_bottomRightCorner" Grid.Column="2" Grid.Row="2" Fill="#FFBBBBBB" />

                <!-- column headers -->
                <c1:DataGridColumnsHeaderPanel x:Name="ColumnsHeader" VerticalAlignment="Top" Grid.Column="1" />

                <!-- data area -->
                <c1:DataGridRowsPanel x:Name="Body" Grid.Column="1" Grid.Row="1" VerticalAlignment="Top" HorizontalAlignment="Left" />

                <!-- row headers -->
                <c1:DataGridRowsHeaderPanel x:Name="RowsHeader" VerticalAlignment="Top" Grid.Row="1" Width="20" />

                <Grid x:Name="LoadingBackground" Background="#7FFFFFFF" IsHitTestVisible="False" Opacity="0" Grid.RowSpan="3" Grid.ColumnSpan="3">
                    <Grid Height="25" Width="25">
                        <Ellipse StrokeThickness="1" Margin="-10,-10,-10,-10">
                            <Ellipse.Fill>
                                <RadialGradientBrush>
                                    <GradientStop Color="#FFFFFFFF" Offset="0.6" />
                                    <GradientStop Color="#00FFFFFF" Offset="1" />
                                </RadialGradientBrush>
                            </Ellipse.Fill>
                        </Ellipse>
                        <Path Stretch="Fill" StrokeThickness="1" Data="M15,6.5 C10.305579,6.5 6.5,10.305579 6.5,15 C6.5,19.69442 10.305579,23.5 15,23.5 C19.69442,23.5 23.5,19.69442 23.5,15 C23.5,10.305579 19.69442,6.5 15,6.5 z M15,0.5 C23.008129,0.5 29.5,6.9918714 29.5,15 C29.5,23.008129 23.008129,29.5 15,29.5 C6.9918714,29.5 0.5,23.008129 0.5,15 C0.5,6.9918714 6.9918714,0.5 15,0.5 z">
                            <Path.Fill>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FF6679AA" />
                                    <GradientStop Color="#FF30A7CE" Offset="0.996" />
                                </LinearGradientBrush>
                            </Path.Fill>
                        </Path>
                        <Path Stretch="Fill" StrokeThickness="1" Data="M15,6.5 C10.305579,6.5 6.5,10.305579 6.5,15 C6.5,19.69442 10.305579,23.5 15,23.5 C19.69442,23.5 23.5,19.69442 23.5,15 C23.5,10.305579 19.69442,6.5 15,6.5 z M15,0.5 C23.008129,0.5 29.5,6.9918714 29.5,15 C29.5,23.008129 23.008129,29.5 15,29.5 C6.9918714,29.5 0.5,23.008129 0.5,15 C0.5,6.9918714 6.9918714,0.5 15,0.5 z">
                            <Path.Fill>
                                <RadialGradientBrush>
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.205" ScaleY="1.205" />
                                            <SkewTransform CenterX="0.5" CenterY="0.5" />
                                            <RotateTransform CenterX="0.5" CenterY="0.5" />
                                            <TranslateTransform X="0.004" Y="0.1" />
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="#FFFFFFFF" Offset="1" />
                                    <GradientStop Color="#00FFFFFF" Offset="0.6" />
                                </RadialGradientBrush>
                            </Path.Fill>
                        </Path>
                        <Path Stretch="Fill" StrokeThickness="1" Data="M15,6.5 C10.305579,6.5 6.5,10.305579 6.5,15 C6.5,19.69442 10.305579,23.5 15,23.5 C19.69442,23.5 23.5,19.69442 23.5,15 C23.5,10.305579 19.69442,6.5 15,6.5 z M15,0.5 C23.008129,0.5 29.5,6.9918714 29.5,15 C29.5,23.008129 23.008129,29.5 15,29.5 C6.9918714,29.5 0.5,23.008129 0.5,15 C0.5,6.9918714 6.9918714,0.5 15,0.5 z">
                            <Path.Fill>
                                <RadialGradientBrush>
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.205" ScaleY="1.205" />
                                            <SkewTransform CenterX="0.5" CenterY="0.5" />
                                            <RotateTransform CenterX="0.5" CenterY="0.5" />
                                            <TranslateTransform X="0.009" Y="-0.119" />
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="#FFFFFFFF" Offset="1" />
                                    <GradientStop Color="#00FFFFFF" Offset="0.65" />
                                </RadialGradientBrush>
                            </Path.Fill>

                        </Path>
                        <Path Stretch="Fill" StrokeThickness="1" Data="M15,6.5 C10.305579,6.5 6.5,10.305579 6.5,15 C6.5,19.69442 10.305579,23.5 15,23.5 C19.69442,23.5 23.5,19.69442 23.5,15 C23.5,10.305579 19.69442,6.5 15,6.5 z M15,0.5 C23.008129,0.5 29.5,6.9918714 29.5,15 C29.5,23.008129 23.008129,29.5 15,29.5 C6.9918714,29.5 0.5,23.008129 0.5,15 C0.5,6.9918714 6.9918714,0.5 15,0.5 z">
                            <Path.Fill>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#006679AA" Offset="0" />
                                    <GradientStop Color="#FF113450" Offset="0.45" />
                                    <GradientStop Color="#FF113450" Offset="0.55" />
                                    <GradientStop Color="#0030A7CE" Offset="1" />
                                </LinearGradientBrush>
                            </Path.Fill>
                        </Path>
                        <Path Stretch="Fill" StrokeThickness="1" Data="M15,6.5 C10.305579,6.5 6.5,10.305579 6.5,15 C6.5,19.69442 10.305579,23.5 15,23.5 C19.69442,23.5 23.5,19.69442 23.5,15 C23.5,10.305579 19.69442,6.5 15,6.5 z M15,0.5 C23.008129,0.5 29.5,6.9918714 29.5,15 C29.5,23.008129 23.008129,29.5 15,29.5 C6.9918714,29.5 0.5,23.008129 0.5,15 C0.5,6.9918714 6.9918714,0.5 15,0.5 z" Margin="-0.5,-0.5,-0.5,-0.5">
                            <Path.Stroke>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FF657AAA" Offset="0.3" />
                                    <GradientStop Color="#FF113450" Offset="0.5" />
                                    <GradientStop Color="#FF31A5CC" Offset="0.7" />
                                </LinearGradientBrush>
                            </Path.Stroke>
                        </Path>
                        <Path Stretch="Fill" StrokeThickness="1" Data="M15,6.5 C10.305579,6.5 6.5,10.305579 6.5,15 C6.5,19.69442 10.305579,23.5 15,23.5 C19.69442,23.5 23.5,19.69442 23.5,15 C23.5,10.305579 19.69442,6.5 15,6.5 z M15,0.5 C23.008129,0.5 29.5,6.9918714 29.5,15 C29.5,23.008129 23.008129,29.5 15,29.5 C6.9918714,29.5 0.5,23.008129 0.5,15 C0.5,6.9918714 6.9918714,0.5 15,0.5 z" x:Name="path" RenderTransformOrigin="0.5,0.5">
                            <Path.Fill>
                                <RadialGradientBrush>
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="0.478" ScaleY="0.495" />
                                            <SkewTransform CenterX="0.5" CenterY="0.5" />
                                            <RotateTransform CenterX="0.5" CenterY="0.5" />
                                            <TranslateTransform X="-0.371" Y="-0.006" />
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="#00FFFFFF" Offset="1" />
                                    <GradientStop Color="#FFFFFFFF" Offset="0.25" />
                                </RadialGradientBrush>
                            </Path.Fill>
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform />
                                    <SkewTransform />
                                    <RotateTransform />
                                    <TranslateTransform />
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>
                </Grid>
                
                <!-- Popup -->
                <Popup x:Name="Popup" />
            </Grid>
        </ControlTemplate>
        <!-- Default style for sort by toggle button -->
        <Style x:Key="SortbyStyle" TargetType="ToggleButton">
            <Setter Property="Background" Value="#FF1F3B53" />
            <Setter Property="Foreground" Value="#FF000000" />
            <Setter Property="Padding" Value="3" />
            <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="ToggleButton">
                        <Grid>
                            <Grid.Resources>
                                <SolidColorBrush x:Key="DisabledBrush" Color="#A5FFFFFF" />
                            </Grid.Resources>
                            <vsm:VisualStateManager.VisualStateGroups>
                                <vsm:VisualStateGroup x:Name="CommonStates">
                                    <vsm:VisualStateGroup.Transitions>
                                        <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver" />
                                        <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed" />
                                    </vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualState x:Name="Normal" />
                                    <vsm:VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Background" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Pressed">
                                        <Storyboard />
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Disabled">
                                        <Storyboard />
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                                <vsm:VisualStateGroup x:Name="CheckStates">
                                    <vsm:VisualState x:Name="Indeterminate">
                                        <Storyboard />
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Checked">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Sortby_arrow" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Sortby_arrow" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Unchecked">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Sortby_arrow" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Sortby_arrow" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="180" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Sortby_arrow" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                                <vsm:VisualStateGroup x:Name="FocusStates">
                                    <vsm:VisualState x:Name="Focused" />
                                    <vsm:VisualState x:Name="Unfocused" />
                                </vsm:VisualStateGroup>
                            </vsm:VisualStateManager.VisualStateGroups>
                            <Rectangle x:Name="Background" RadiusX="3" RadiusY="3" Margin="1,2,0,2" Stroke="#B2FFFFFF" Opacity="0">
                                <Rectangle.Fill>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#B2C8E3FF" />
                                        <GradientStop Color="#B288CEFF" Offset="1" />
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                            <Rectangle x:Name="DisabledVisual" Opacity="0" RadiusX="0" RadiusY="0" Fill="{StaticResource DisabledBrush}" />
                            <Path Height="4" Width="7" Grid.Row="1" Stretch="Fill" StrokeThickness="1" Data="M0,0 L7,0 L3.5,4 L3.5,4 z" Opacity="0" x:Name="Sortby_arrow" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="0,0.5,0,0" RenderTransformOrigin="0.5,0.5" Visibility="Collapsed">
                                <Path.Stroke>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="-0.0199999995529652,0.0560000017285347">
                                        <GradientStop Color="#FF91C1D8" Offset="0" />
                                        <GradientStop Color="#FFA3CCDE" Offset="0.5" />
                                        <GradientStop Color="#FF6296AD" Offset="1" />
                                    </LinearGradientBrush>
                                </Path.Stroke>
                                <Path.Fill>
                                    <LinearGradientBrush EndPoint="0.48199999332428,0.885999977588654" StartPoint="0.0109999999403954,0.0329999998211861">
                                        <GradientStop Color="#6691C1D8" Offset="0" />
                                        <GradientStop Color="#66A3CCDE" Offset="0.5" />
                                        <GradientStop Color="#666296AD" Offset="1" />
                                    </LinearGradientBrush>
                                </Path.Fill>
                                <Path.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform />
                                        <SkewTransform />
                                        <RotateTransform />
                                        <TranslateTransform />
                                    </TransformGroup>
                                </Path.RenderTransform>
                            </Path>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ColumnHeaderTemplate" TargetType="c1:DataGridColumnHeaderPresenter">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="c1:DataGridColumnHeaderPresenter">
                        <Grid Height="24">
                    		<Rectangle x:Name="Border" RadiusX="2" RadiusY="2" Margin="0,0,1.71399998664856,0">
                    			<Rectangle.Fill>
                    				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    					<GradientStop Color="#FF2E8DD1" Offset="0.428" />
                    					<GradientStop Color="#FF2E8DD1" Offset="1" />
                    					<GradientStop Color="#FF2E8DD1" Offset="0" />
                    					<GradientStop Color="#FF0D4E86" Offset="0.548" />
                    				</LinearGradientBrush>
                    			</Rectangle.Fill>
                    		</Rectangle>
                            <ToggleButton x:Name="Sort" Visibility="Visible" Style="{StaticResource SortbyStyle}" IsHitTestVisible="True" IsTabStop="False" />
                            <ContentControl Margin="2,2,2,2" Content="{TemplateBinding Content}" Foreground="#FFFFFFFF" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center" />
                    		<!--<TextBlock x:Name="Text" Text="{TemplateBinding Content}" TextWrapping="Wrap" />-->
                            <Rectangle x:Name="Resize" Fill="White" Width="4" HorizontalAlignment="Right" Cursor="SizeWE" Opacity="0" Margin="0 0 -2 0" />
                    	</Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="RowStyle" TargetType="c1:DataGridRowPresenter">
            <Setter Property="FontSize" Value="14" />
        </Style>
        <Style x:Key="DataGridFocusPresenterStyle1" TargetType="c1:DataGridFocusPresenter">
        	<Setter Property="IsHitTestVisible" Value="false" />
        	<Setter Property="Template">
        		<Setter.Value>
        			<ControlTemplate TargetType="c1:DataGridFocusPresenter">
        				<Grid>
        					<Rectangle Stroke="Black" StrokeDashArray="2 2" RadiusX="4" RadiusY="4" />
        				</Grid>
        			</ControlTemplate>
        		</Setter.Value>
        	</Setter>
        </Style>
    </UserControl.Resources>

    <Grid x:Name="gridArea" RenderTransformOrigin="0.5,0.5">
        <Grid.Resources>
            <SolidColorBrush x:Key="WatermarkBrush" Color="#FFAAAAAA" />
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="70" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="249.85" />
        </Grid.ColumnDefinitions>
        <Grid.RenderTransform>
            <TransformGroup>
                <ScaleTransform ScaleX="1" ScaleY="1" />
                <SkewTransform AngleX="0" AngleY="0" />
                <RotateTransform Angle="0" />
                <TranslateTransform X="0" Y="0" />
            </TransformGroup>
        </Grid.RenderTransform>

        <Path Stretch="Fill" Stroke="#FF00233F" StrokeThickness="1" Data="F1 M0.5,0.5000037 L5.5000024,0.5000037 8.3339949,0.5000037 689.83301,0.5000037 694.5,0.5000037 699.5,0.5000037 699.5,5.4999952 699.5,10.000003 699.5,484.5 C699.5,487.26141 697.26141,489.5 694.5,489.5 L5.5000024,489.5 C2.7385762,489.5 0.5,487.26141 0.5,484.5 L0.5,10.334 0.5,5.4999952 0.5,0.5000037 z" x:Name="content" Margin="0,0,0,3" Grid.RowSpan="4">
            <Path.Fill>
                <LinearGradientBrush EndPoint="0.489,1.25" StartPoint="0.49,0.01">
                    <GradientStop Color="#FF00233F" Offset="0" />
                    <GradientStop Color="#5200233F" Offset="1" />
                </LinearGradientBrush>
            </Path.Fill>
        </Path>

        <Rectangle StrokeThickness="1" RadiusX="0" RadiusY="0" Opacity="0.975" x:Name="contentHighlight" Margin="0,0,1,3" Grid.RowSpan="4">
            <Rectangle.Fill>
                <LinearGradientBrush EndPoint="0.88,0.484" StartPoint="1.268,-0.851">
                    <GradientStop Color="#FFFFFFFF" Offset="0" />
                    <GradientStop Color="#00FFFFFF" Offset="0.923" />
                </LinearGradientBrush>
            </Rectangle.Fill>
        </Rectangle>

        <Rectangle StrokeThickness="1" RadiusX="5" RadiusY="5" Margin="8.00800037384033,2.50500011444092,8.94699954986572,2" Grid.Row="1">
            <Rectangle.Fill>
                <LinearGradientBrush EndPoint="0.489,-0.25" StartPoint="0.489,1.133">
                    <GradientStop Color="#26FFFFFF" Offset="1" />
                    <GradientStop Color="#00FFFFFF" Offset="0" />
                </LinearGradientBrush>
            </Rectangle.Fill>
        </Rectangle>

        <Rectangle Height="18" StrokeThickness="1" RadiusX="5" RadiusY="5" Margin="12.0080003738403,0,13.2799997329712,8" VerticalAlignment="Bottom" Grid.Row="1">
            <Rectangle.Fill>
                <LinearGradientBrush EndPoint="0.489,-0.25" StartPoint="0.489,1.133">
                    <GradientStop Color="#71041A4B" Offset="1" />
                    <GradientStop Color="#00011235" Offset="0" />
                </LinearGradientBrush>
            </Rectangle.Fill>
        </Rectangle>

        <TextBlock x:Name="lblStatus" Height="18" FontFamily="Verdana" FontSize="12" FontWeight="Normal" Foreground="#FFFFFFFF" Text="Ready" Margin="21.007999420166,0,66.2799987792969,8" VerticalAlignment="Bottom" Grid.Row="1" />
    	<Grid HorizontalAlignment="Stretch" Margin="12.0080003738403,7,15,30" VerticalAlignment="Stretch" Grid.Row="1">
    		<Rectangle x:Name="grdMain" Stroke="#FF00233F" RadiusX="5" RadiusY="5" Fill="#FFFFFFFF" StrokeThickness="1" Opacity="0.705" Margin="0,0,0,0" />
    		<c1:C1DataGrid x:Name="gridMain" RowStyle="{StaticResource RowStyle}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="4,4,4,4" RowHeight="32" AutoGenerateColumns="False" HeadersVisibility="Column" Template="{StaticResource C1DataGridTemplate}" ColumnHeaderStyle="{StaticResource ColumnHeaderTemplate}" SelectionMode="None" RowDetailsVisibilityMode="Collapsed" GridLinesVisibility="None" CanUserFilter="False" CanUserEditRows="False" CanUserAddRows="False" FrozenColumnCount="1" LoadingRow="gridMain_LoadingRow" MouseOverBrush="#00B6DEE8" FocusStyle="{StaticResource DataGridFocusPresenterStyle1}">
                <c1:C1DataGrid.Columns>
                    <c1:DataGridTemplateColumn Header="Symbol" HorizontalAlignment="Left" Width="150" SortMemberPath="Symbol" SortState="Ascending" CanUserMove="False">
                        <c1:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <StockPortfolio:SPCell MyDataContext="{Binding}" />
                            </DataTemplate>
                        </c1:DataGridTemplateColumn.CellTemplate>
                    </c1:DataGridTemplateColumn>
                    <c1:DataGridNumericColumn Binding="{Binding Last_Price}" Header="Last Price" Width="80" Format="f2" SortMemberPath="Last_Price" />
                    <c1:DataGridTemplateColumn Header="Chart" HorizontalAlignment="Center" Width="60">
                        <c1:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
		                        <Button x:Name="btnChart" Background="White" Style="{StaticResource btnChartStyle}" Cursor="Hand" Click="btnChart_Click" HorizontalAlignment="Center" VerticalAlignment="Center" />
                            </DataTemplate>
                        </c1:DataGridTemplateColumn.CellTemplate>
                    </c1:DataGridTemplateColumn>
                    <c1:DataGridTemplateColumn Header="Remove" HorizontalAlignment="Center" Width="60">
                        <c1:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                        		<Button x:Name="btnDelete" Style="{StaticResource btnDeleteStyle}" Cursor="Hand" Click="btnDelete_Click" />
                            </DataTemplate>
                        </c1:DataGridTemplateColumn.CellTemplate>
                    </c1:DataGridTemplateColumn>
                    <c1:DataGridNumericColumn Header="Open" Binding="{Binding Open}" Width="80" Format="f2" SortMemberPath="Open" />
                    <c1:DataGridNumericColumn Header="High" Binding="{Binding High}" Width="80" Format="f2" SortMemberPath="High" />
                    <c1:DataGridNumericColumn Header="Low" Binding="{Binding Low}" Width="80" Format="f2" SortMemberPath="Low" />
                    <c1:DataGridDateTimeColumn Header="Date" Binding="{Binding Date}" Width="100" SortMemberPath="Date" Format="d" />
                    <c1:DataGridNumericColumn Header="Shares" Binding="{Binding Shares}" Width="80" Format="f" SortMemberPath="Shares" />
                    <c1:DataGridNumericColumn Header="Price" Binding="{Binding Price}" Width="80" Format="c" SortMemberPath="Price" />
                    <c1:DataGridNumericColumn Header="Commission" Binding="{Binding Commission}" Width="100" Format="c0" SortMemberPath="Commission" />
                    <c1:DataGridNumericColumn Header="Cost Basis" Binding="{Binding Cost_Basis}" Width="100" Format="c0" SortMemberPath="Cost_Basis" />
                    <c1:DataGridNumericColumn Header="Market Value" Binding="{Binding Market_Value}" Width="100" Format="c0" SortMemberPath="Market_Value" />
                    <c1:DataGridNumericColumn Header="Gain" Binding="{Binding Gain}" Width="100" Format="c0" SortMemberPath="Gain" />
                    <c1:DataGridNumericColumn Header="Gain%" Binding="{Binding Gain_0025}" Width="80" Format="p0" SortMemberPath="Gain_0025" />
                    <c1:DataGridTextColumn Header="Notes" Binding="{Binding Notes}" Width="200" SortMemberPath="Notes" />
                </c1:C1DataGrid.Columns>
            </c1:C1DataGrid>
    		<!--<Rectangle x:Name="DisableGrid" RadiusX="5" RadiusY="5" Fill="#FFFFFFFF" StrokeThickness="1" Opacity="0.5" IsHitTestVisible="True"/>-->
    	</Grid>
    	<CheckBox HorizontalAlignment="Right" Margin="0,0,36.8199996948242,0" VerticalAlignment="Bottom" x:Name="chkTransactions" Checked="chkTransactions_Checked" Unchecked="chkTransactions_Checked">
    		<TextBlock FontFamily="Lucida Sans Unicode" FontSize="9" FontWeight="Normal" Foreground="#FFFFFFFF" Text="SHOW TRANSACTIONS" />
    	</CheckBox>
    	<StockPortfolio:Transactions Grid.Row="2" HorizontalAlignment="Left" />
			<TextBlock RenderTransformOrigin="0,0.333" Width="323.326" FontSize="8" Text="Information provided for demonstration purposes only, not for trading or advice." Foreground="#FFFFFFFF" Opacity="0.55" HorizontalAlignment="Left" Margin="16,8,0,8" VerticalAlignment="Stretch" Grid.Row="3" />
    	<StockPortfolio:MarketSummary Grid.Column="1" Margin="4,0,0,0" Grid.RowSpan="4" />
    	<Grid HorizontalAlignment="Left" Margin="8,0,0,0" VerticalAlignment="Stretch" Width="270">
    		<Grid.ColumnDefinitions>
    			<ColumnDefinition Width="0.7*" />
    			<ColumnDefinition Width="0.3*" />
    		</Grid.ColumnDefinitions>
    		<Grid Height="37.667" HorizontalAlignment="Stretch" Margin="9,14,10.1660003662109,18.3330001831055" VerticalAlignment="Stretch" Width="61.834" d:LayoutOverrides="Width" Grid.Column="1">
    			<Rectangle StrokeThickness="1" RadiusX="5" RadiusY="5" HorizontalAlignment="Stretch">
    				<Rectangle.Fill>
    					<LinearGradientBrush EndPoint="0.489,-0.25" StartPoint="0.489,1.133">
    						<GradientStop Color="#26FFFFFF" Offset="1" />
    						<GradientStop Color="#00FFFFFF" Offset="0" />
    					</LinearGradientBrush>
    				</Rectangle.Fill>
    			</Rectangle>
    			<Button Height="12.918" HorizontalAlignment="Stretch" Margin="4.00799989700317,3.83500003814697,4,0" VerticalAlignment="Top" Style="{StaticResource ButtonStyle3}">
    				<StackPanel Orientation="Horizontal">
    					<Canvas Height="8" Margin="-2,0,0,0" Width="8">
    						<StockPortfolio:PlusIcon Height="16" Width="16" Canvas.Left="-4" Canvas.Top="-4" />
    					</Canvas>
    					<TextBlock FontFamily="Lucida Sans Unicode" FontSize="8" FontWeight="Normal" Foreground="#FFFFFFFF" Text="ADD" x:Name="lblPortfolioName5" Margin="8,0,0,0" />
    				</StackPanel>
    			</Button>
    			<Button Height="13.082" HorizontalAlignment="Stretch" Margin="3.625,0,4,3.83200001716614" VerticalAlignment="Bottom" Style="{StaticResource ButtonStyle3}">
    				<StackPanel Orientation="Horizontal">
    					<Canvas Height="8" Margin="-2,0,0,0" Width="8">
    						<StockPortfolio:DeleteIcon Height="16" Width="16" Canvas.Left="-3.5" Canvas.Top="-3.125" />
    					</Canvas>
    					<TextBlock FontFamily="Lucida Sans Unicode" FontSize="8" FontWeight="Normal" Foreground="#FFFFFFFF" Text="REMOVE" x:Name="lblPortfolioName6" Margin="5,0,0,0" />
    				</StackPanel>
    			</Button>
    		</Grid>
            <c1:C1DropDownButton x:Name="portfolioMenu" Margin="4,14,7.00799989700317,18.3330001831055" Style="{StaticResource PortfolioMenuStyle}">
                <c1:C1DropDownButton.Header>
                    <TextBlock x:Name="lblPortfolio" FontFamily="Lucida Sans Unicode" FontSize="16" FontWeight="Normal" Foreground="#FFFFFFFF" Text="My Portfolio" HorizontalAlignment="Center" />
                </c1:C1DropDownButton.Header>
                <c1:C1DropDownButton.Content>
				    <Border BorderThickness="1" BorderBrush="#FF207A9C" Background="#FFEFF5FF" Width="200">
					    <!-- We do not use a Listbox because it swallows the clicks -->
					    <ItemsControl x:Name="listBox" Margin="2 2 2 2" />
				    </Border>
                </c1:C1DropDownButton.Content>
            </c1:C1DropDownButton>
    	</Grid>
    </Grid>
</UserControl>