<UserControl x:Class="SicUI.Models.PMs.Charting.PMChartingV2View"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:s="http://schemas.abtsoftware.co.uk/scichart"
             xmlns:local="clr-namespace:SicUI.Models.PMs.Charting"
             xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
             xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
             xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
             xmlns:micro="http://www.caliburn.org"
             xmlns:control="clr-namespace:Aitex.Core.UI.Control;assembly=MECF.Framework.UI.Core"
             xmlns:controls="http://OpenSEMI.Ctrlib.com/presentation"
             xmlns:converters="clr-namespace:Aitex.Core.UI.Converters;assembly=MECF.Framework.UI.Core"
             xmlns:converter="clr-namespace:MECF.Framework.UI.Client.Ctrlib.Converter;assembly=MECF.Framework.UI.Client"
             xmlns:lex="http://wpflocalizeextension.codeplex.com"
             mc:Ignorable="d" 
             d:DesignHeight="780" d:DesignWidth="1900" Background="#91b0cd"
             lex:LocalizeDictionary.DesignCulture="zh"
             lex:ResxLocalizationProvider.DefaultAssembly="Sicentury.Localization"
             lex:ResxLocalizationProvider.DefaultDictionary="lang_common">
    <UserControl.Resources>
        <converters:LineColorConverter x:Key="colorConverter"/>

        <Style TargetType="Button" x:Key="ChartingButtonStyle">
            <Setter Property="Margin" Value="3" />
            <Setter Property="Background" Value="#FF323539" />
            <Setter Property="Foreground" Value="#FFF" />
            <Setter Property="Padding" Value="3" />
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="BorderBrush" Value="#FF5B5B5B" />
            <Setter Property="Width" Value="35" />
            <Setter Property="Height" Value="35" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border Name="Border" Margin="{TemplateBinding Margin}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2" Opacity="0.6" Padding="{TemplateBinding Padding}">
                            <ContentPresenter Name="ContentHost" HorizontalAlignment="Center" VerticalAlignment="Center" ContentTemplate="{TemplateBinding ContentTemplate}"  />
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="Border" Property="Opacity" Value="1"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style TargetType="Line" x:Key="AnomationStyle">
            <Setter Property="Stroke" Value="Black"/>
            <Setter Property="StrokeThickness" Value="2"/>
            <Setter Property="StrokeDashArray" Value="2 2"/>
            <Setter Property="IsHitTestVisible" Value="False"/>
            <Setter Property="UseLayoutRounding" Value="True"/>
        </Style>

        <DataTemplate x:Key="RolloverTooltipTemplate1" DataType="s:SeriesInfo">
            <TextBlock FontSize="12">
                <TextBlock.Text>
                    <MultiBinding StringFormat="{}{0}:{1}">
                        <Binding Path="SeriesName"></Binding>
                        <Binding Path="FormattedYValue"></Binding>
                    </MultiBinding>
                </TextBlock.Text>
            </TextBlock>
        </DataTemplate>

        <Style TargetType="s:FastLineRenderableSeries" x:Key="LineStyle">
            <Setter Property="s:RolloverModifier.TooltipTemplate" Value="{StaticResource RolloverTooltipTemplate1}"/>
        </Style>
    </UserControl.Resources>
    <Grid x:Name="gridMain">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="520"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid Grid.Column="0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="80"/>
                    <RowDefinition Height="220"/>
                    <RowDefinition Height="30"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Grid Grid.Row="0">
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="80" />
                        <ColumnDefinition Width="130" />
                        <ColumnDefinition Width="80" />
                        <ColumnDefinition Width="130" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>

                    <Border
                        Grid.Row="0"
                        Grid.Column="0"
                        Padding="5,1"
                        Background="{DynamicResource Table_BG_Title}"
                        BorderBrush="{DynamicResource Table_BD}"
                        BorderThickness="0,1,1,1">
                        <TextBlock
                            HorizontalAlignment="Left"
                            VerticalAlignment="Center"
                            FontFamily="Arial"
                            FontSize="12"
                            Foreground="{DynamicResource FG_Black}"
                            Text="{lex:Loc ID_TXT_StartTime}" />
                    </Border>
                    <Border
                        Grid.Row="0"
                        Grid.Column="1"
                        Background="{DynamicResource Table_BG_Content}"
                        BorderBrush="{DynamicResource Table_BD}"
                        BorderThickness="0,1,1,1">
                        <wfi:WindowsFormsHost
                            Width="120"
                            Height="25"
                            Margin="5,0,0,0"
                            VerticalAlignment="Center"
                            FontFamily="Arial"
                            FontSize="12">
                            <wf:DateTimePicker
                                x:Name="wfTimeFrom"
                                CustomFormat="yyyy/MM/dd HH:mm:ss"
                                Format="Custom"
                                Value="2023-8-1" />
                        </wfi:WindowsFormsHost>
                    </Border>

                    <Border
                        Grid.Row="1"
                        Grid.Column="0"
                        Padding="5,1"
                        Background="{DynamicResource Table_BG_Title}"
                        BorderBrush="{DynamicResource Table_BD}"
                        BorderThickness="1">
                        <TextBlock
                            HorizontalAlignment="Left"
                            VerticalAlignment="Center"
                            FontFamily="Arial"
                            FontSize="12"
                            Foreground="{DynamicResource FG_Black}"
                            Text="{lex:Loc ID_TXT_EndTime}" />
                    </Border>
                    <Border
                        Grid.Row="1"
                        Grid.Column="1"
                        Background="{DynamicResource Table_BG_Content}"
                        BorderBrush="{DynamicResource Table_BD}"
                        BorderThickness="0,1,1,1">
                        <wfi:WindowsFormsHost
                            Width="120"
                            Height="25"
                            Margin="5,0,0,0"
                            VerticalAlignment="Center"
                            FontFamily="Arial"
                            FontSize="12">
                            <wf:DateTimePicker
                                x:Name="wfTimeTo"
                                CustomFormat="yyyy/MM/dd HH:mm:ss"
                                Format="Custom"
                                Value="2011-8-1" />
                        </wfi:WindowsFormsHost>
                    </Border>

                    <Border
                        Grid.Row="0"
                        Grid.Column="2"
                        Padding="5,1"
                        Background="{DynamicResource Table_BG_Title}"
                        BorderBrush="{DynamicResource Table_BD}"
                        BorderThickness="0,1,1,1">
                        <TextBlock
                            lex:ResxLocalizationProvider.DefaultDictionary="lang_datalogviews"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Center"
                            FontFamily="Arial"
                            FontSize="12"
                            Foreground="{DynamicResource FG_Black}"
                            Text="{lex:Loc ID_TXT_Chamber}" />
                    </Border>
                    <Border
                        Grid.Row="0"
                        Grid.Column="3"
                        Padding="5,1"
                        Background="{DynamicResource Table_BG_Content}"
                        BorderBrush="{DynamicResource Table_BD}"
                        BorderThickness="0,1,1,1">
                        <toolkit:CheckComboBox
                            x:Name="tbLoadPort"
                            Width="100"
                            Height="30"
                            Margin="0,0,7,0"
                            HorizontalAlignment="Right"
                            VerticalAlignment="Center"
                            FontFamily="Arial"
                            FontSize="14"
                            ItemsSource="{Binding SourcePM}"
                            SelectedValue="{Binding SelectedValuePM}" />
                    </Border>

                    <Border
                        Grid.Row="1"
                        Grid.Column="2"
                        Padding="5,1"
                        Background="{DynamicResource Table_BG_Title}"
                        BorderBrush="{DynamicResource Table_BD}"
                        BorderThickness="0,1,1,1">
                        <TextBlock
                            HorizontalAlignment="Left"
                            VerticalAlignment="Center"
                            FontFamily="Arial"
                            FontSize="12"
                            Foreground="{DynamicResource FG_Black}"
                            Text="{lex:Loc ID_TXT_Recipe}" />
                    </Border>
                    <Border
                        Grid.Row="1"
                        Grid.Column="3"
                        Padding="5,1"
                        Background="{DynamicResource Table_BG_Content}"
                        BorderBrush="{DynamicResource Table_BD}"
                        BorderThickness="0,1,1,1">
                        <TextBox Width="Auto" Height="30" Text="{Binding RecipeName}" />
                    </Border>

                    <Button
                        Grid.Row="0"
                        Grid.Column="4"
                        Width="80"
                        Height="40"
                        Margin="0,0,0,0"
                        FontSize="15"
                        Content="{lex:Loc ID_BTN_Search_Content}">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="Click">
                                <micro:ActionMessage MethodName="SearchRecipe" />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </Button>

                </Grid>
                <DataGrid
                    Grid.Row="1"
                    Margin="2"
                    HorizontalAlignment="Left"
                    AlternationCount="2"
                    AutoGenerateColumns="False"
                    BorderThickness="1"
                    CanUserAddRows="False"
                    CanUserResizeColumns="True"
                    CanUserResizeRows="False"
                    ColumnHeaderHeight="30"
                    FontFamily="Arial"
                    FontSize="12" 
                    ItemsSource="{Binding Recipes}">
                    <DataGrid.Columns>
                        <DataGridTemplateColumn Width="50">
                            <DataGridTemplateColumn.HeaderTemplate>
                                <DataTemplate>
                                    <StackPanel VerticalAlignment="Center" Orientation="Horizontal">
                                        <TextBlock
                                            lex:ResxLocalizationProvider.DefaultDictionary="lang_datalogviews"
                                            Text="{lex:Loc ID_TXT_Add}" Margin="0,0,5,0"/>
                                    </StackPanel>
                                </DataTemplate>
                            </DataGridTemplateColumn.HeaderTemplate>
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>

                                    <CheckBox IsChecked="{Binding Selected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
                                        <i:Interaction.Triggers>
                                            <i:EventTrigger EventName="Click">
                                                <micro:ActionMessage MethodName="CheckRecipe">
                                                    <micro:Parameter Value="{Binding}" />
                                                </micro:ActionMessage>
                                            </i:EventTrigger>
                                        </i:Interaction.Triggers>
                                    </CheckBox>

                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                        <DataGridTemplateColumn 
                            lex:ResxLocalizationProvider.DefaultDictionary="lang_datalogviews"
                            MinWidth="100" Header="{lex:Loc ID_TXT_Mark}">
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock
                                        Margin="5,0"
                                        HorizontalAlignment="Left"
                                        VerticalAlignment="Center"
                                        FontFamily="Arial"
                                        FontSize="14"
                                        Foreground="{DynamicResource FG_Black}"
                                        Text="{Binding ProcessGuid}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                        <DataGridTemplateColumn 
                            lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
                            MinWidth="100" Header="{lex:Loc ID_TXT_Recipe}">
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock
                                        Margin="5,0"
                                        HorizontalAlignment="Left"
                                        VerticalAlignment="Center"
                                        FontFamily="Arial"
                                        FontSize="14"
                                        Foreground="{DynamicResource FG_Black}"
                                        Text="{Binding Recipe}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                        <DataGridTemplateColumn
                            lex:ResxLocalizationProvider.DefaultDictionary="lang_datalogviews"
                            Width="60" Header="{lex:Loc ID_TXT_Module}">
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock
                                        Margin="5,0"
                                        HorizontalAlignment="Left"
                                        VerticalAlignment="Center"
                                        FontFamily="Arial"
                                        FontSize="14"
                                        Foreground="{DynamicResource FG_Black}"
                                        Text="{Binding Chamber}" />

                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                        <DataGridTemplateColumn
                            lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
                            MinWidth="100" Header="{lex:Loc ID_TXT_StartTime}">
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock
                                        Margin="5,0"
                                        HorizontalAlignment="Left"
                                        VerticalAlignment="Center"
                                        FontFamily="Arial"
                                        FontSize="14"
                                        Foreground="{DynamicResource FG_Black}"
                                        Text="{Binding StartTime}" />

                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                        <DataGridTemplateColumn 
                            lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
                            MinWidth="100" Header="{lex:Loc ID_TXT_EndTime}">
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock
                                        Margin="5,0"
                                        HorizontalAlignment="Left"
                                        VerticalAlignment="Center"
                                        FontFamily="Arial"
                                        FontSize="14"
                                        Foreground="{DynamicResource FG_Black}"
                                        Text="{Binding EndTime}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                        <DataGridTemplateColumn MinWidth="60" Header="Result">
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock
                                        Margin="5,0"
                                        HorizontalAlignment="Left"
                                        VerticalAlignment="Center"
                                        FontFamily="Arial"
                                        FontSize="14"
                                        Foreground="{DynamicResource FG_Black}"
                                        Text="{Binding Status}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                    </DataGrid.Columns>
                </DataGrid>
                <Grid Grid.Row="2">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="60"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Left">
                        <TextBlock Text="{lex:Loc ID_TXT_Filter}" VerticalAlignment="Bottom" FontSize="18" Height="30" Margin="5,0,5,0" HorizontalAlignment="Right"/>
                        <TextBox x:Name="tbxkeyword" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="200" Height="30" Margin="5,0,5,0" Foreground="Black"/>
                        <Button VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,5,0" Height="25">
                            <Button.Background>
                                <ImageBrush ImageSource="pack://application:,,,/Resources/Images/find.png" Stretch="Uniform"/>
                            </Button.Background>
                            <i:Interaction.Triggers>
                                <i:EventTrigger EventName="Click">
                                    <micro:ActionMessage MethodName="Find">
                                        <micro:Parameter Value="{Binding ElementName=tbxkeyword,Path=Text}"/>
                                    </micro:ActionMessage>
                                </i:EventTrigger>
                            </i:Interaction.Triggers>
                        </Button>
                    </StackPanel>

                    <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,5,0">
                        <Button Content="X" VerticalAlignment="Center" HorizontalAlignment="Left">
                            <i:Interaction.Triggers>
                                <i:EventTrigger EventName="Click">
                                    <micro:ActionMessage MethodName="RemoveAllLine">
                                    </micro:ActionMessage>
                                </i:EventTrigger>
                            </i:Interaction.Triggers>
                        </Button>
                    </StackPanel>
                </Grid>
                <Border Grid.Row="3" BorderBrush="{DynamicResource MainFrame_BD_Highlight}" BorderThickness="1" SnapsToDevicePixels="True" Background="{DynamicResource Tab_BG}" Padding="2">
                    <TreeView x:Name="ParameterTreeView" ItemsSource="{Binding ConfigNodes}" >
                        <TreeView.ItemTemplate>
                            <HierarchicalDataTemplate  ItemsSource="{Binding PMNodeInfo}" >
                                <StackPanel Orientation="Horizontal">
                                    <CheckBox IsChecked="{Binding Selected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" >
                                        <i:Interaction.Triggers>
                                            <i:EventTrigger EventName="Click">
                                                <micro:ActionMessage MethodName="ParameterCheck">
                                                    <micro:Parameter Value="{Binding }"/>
                                                </micro:ActionMessage>
                                            </i:EventTrigger>
                                        </i:Interaction.Triggers>
                                    </CheckBox>
                                    <TextBlock Text="{Binding NodeStr}"  />
                                </StackPanel>
                            </HierarchicalDataTemplate>
                        </TreeView.ItemTemplate>

                        <TreeView.ItemContainerStyle>
                            <Style TargetType="{x:Type TreeViewItem}" BasedOn="{StaticResource ResourceKey={x:Type TreeViewItem}}">
                                <Setter Property="Visibility" Value="{Binding Path=IsMatch, Mode=OneWay, Converter={StaticResource ResourceKey=BoolVisibilityConverter}}"></Setter>
                            </Style>
                        </TreeView.ItemContainerStyle>
                    </TreeView>
                </Border>
            </Grid>
            <Grid Grid.Column="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="1*"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid Grid.Row="0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>

                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition  Height="40"/>
                        </Grid.RowDefinitions>
                        <StackPanel Background="#eee">
                            <Button Command="{Binding DefaultZoomCommand}"
                                            Padding="0"
                                            FontSize="11"
                                            Content="Zoom"
                                            Style="{StaticResource ChartingButtonStyle}"/>

                            <Button Command="{Binding ShowLegendCommand}"
                                            Padding="0"
                                            FontSize="11"
                                            Content="Line"
                                            Style="{StaticResource ChartingButtonStyle}"/>
                        </StackPanel>
                        <StackPanel Background="#eee" Grid.Row="1">
                            <Button Command="{Binding DataDetailVisbleCommand}"
                                            Padding="0"
                                            FontSize="11"
                                            Content="Data"
                                            Style="{StaticResource ChartingButtonStyle}"/>
                        </StackPanel>
                    </Grid>
                    <Grid Grid.Column="1" >
                        <s:SciChartSurface Name="sciChart" RenderableSeries="{s:SeriesBinding SelectedData}"
                                      s:ThemeManager.Theme="ExpressionLight"
                                      Padding="0,0,0,0" 
                                      DebugWhyDoesntSciChartRender="false" BorderBrush="Black" Focusable="False" IsTabStop="False" ViewportManager="{Binding ViewportManager}">

                            <!-- 变更曲线起始点行为 -->
                            <i:Interaction.Behaviors>
                                <local:SciChartMouseDownChangingLocationBehavior 
                                        Target="{Binding SelectedData}"
                                        XAxisInfo="{Binding ElementName=cm,Path= XAxisInfo}"
                                        YAxisInfo="{Binding ElementName=cm,Path= YAxisInfo}"/>
                            </i:Interaction.Behaviors>

                            <!-- Create an X Axis -->
                            <s:SciChartSurface.XAxis>
                                <s:NumericAxis DrawMinorTicks="False" 
                                    DrawMinorGridLines="True" Focusable="False" 
                                    TitleFontSize="15"
                                    FontSize="15"  
                                    AutoRange="{Binding ChartAutoRange}"
                                    VisibleRangeLimit="{Binding VisibleRangeXLimit}"
                                    VisibleRange="{Binding VisibleRangeX}"
                                    Id="DefaultAxisId" TitleFontWeight="Normal" />

                            </s:SciChartSurface.XAxis>

                            <!-- Create a Y Axis -->
                            <s:SciChartSurface.YAxis>
                                <s:NumericAxis DrawMinorTicks="False" MinWidth="50"
                                          DrawMinorGridLines="True" 
                                          AxisAlignment="Right"
                                   HorizontalAlignment="Center"
                                   CursorTextFormatting="0.#####"
                                   VisibleRange="{Binding VisibleRangeY}"
                                   VisibleRangeLimit="{Binding VisibleRangeYLimit}"
                                   Id="DefaultAxisId" MajorDelta="0.1" 
                                   MinorDelta="0.1" DrawMajorBands="False" Focusable="False" 
                                   BorderThickness="0" AutoRange="{Binding ChartAutoRange}" 
                                   DrawLabels="True" DrawMajorGridLines="True" DrawMajorTicks="False">
                                    <s:NumericAxis.GrowBy>
                                        <s:DoubleRange Min="0.1" Max="0.1"/>
                                    </s:NumericAxis.GrowBy>
                                </s:NumericAxis>
                            </s:SciChartSurface.YAxis>

                            <s:SciChartSurface.ChartModifier>

                                <s:ModifierGroup>
                                    <s:RubberBandXyZoomModifier x:Name="rubberBandZoomModifier" IsEnabled="True" 
                                                           IsXAxisOnly="False" 
                                                           ZoomExtentsY="True" 
                                                           IsAnimated="True" ExecuteOn="MouseLeftButton" ReceiveHandledEvents="True" />

                                    <s:CursorModifier Name="cm" IsEnabled="True"  ShowTooltipOn="MouseOver"  ShowAxisLabels="True"  
                                          SourceMode="AllSeries" ShowTooltip="False" />

                                    <s:LegendModifier ShowLegend="False" GetLegendDataFor="AllSeries" x:Name="legendModifier"/>

                                    <s:ZoomExtentsModifier x:Name="zoomExtentsModifier"  XyDirection="XYDirection" ExecuteOn="MouseDoubleClick"/>

                                    <s:ZoomPanModifier x:Name="zoomPanModifier" IsEnabled="True"  ClipModeX="None" XyDirection="XYDirection" ExecuteOn="MouseRightButton" ZoomExtentsY="False" />

                                    <s:MouseWheelZoomModifier x:Name="mouseWheelZoomModifier" IsEnabled="True" XyDirection="XYDirection"/>

                                    <s:RolloverModifier IsEnabled="True" DrawVerticalLine="True" ShowAxisLabels="False" x:Name="RolloverModifier"
                                        ShowTooltipOn="Always" SourceMode="AllSeries" ExecuteOn="MouseMove" >
                                        <s:RolloverModifier.LineOverlayStyle>
                                            <!-- The style for the rollover line -->
                                            <Style TargetType="Line">
                                                <Setter Property="Stroke" Value="Pink"/>
                                                <Setter Property="StrokeThickness" Value="2"/>
                                                <Setter Property="StrokeDashArray" Value="2 2"/>
                                                <Setter Property="IsHitTestVisible" Value="False"/>
                                                <Setter Property="UseLayoutRounding" Value="True"/>
                                            </Style>
                                        </s:RolloverModifier.LineOverlayStyle>
                                    </s:RolloverModifier>

                                    <s:YAxisDragModifier DragMode="Scale"/>
                                    <s:XAxisDragModifier DragMode="Pan"/>
                                    <s:LegendModifier ShowLegend="{Binding ShowLegendInfo}"/>

                                </s:ModifierGroup>

                            </s:SciChartSurface.ChartModifier>
                        </s:SciChartSurface>
                    </Grid>

                </Grid>
                <Grid Grid.Row="1" Visibility="{Binding DataDetailVisbility}">
                    <TabControl Grid.Row="1"  Margin="5" MinHeight="300">
                        <TabItem Height="24" VerticalAlignment="Top">
                            <Grid>
                                <DataGrid  Margin="5"  HorizontalAlignment="Left" BorderThickness="1"
                                          AlternationCount="2" ColumnHeaderHeight="30" 
                                          ItemsSource="{Binding SelectedData}" AutoGenerateColumns="False" 
                                          CanUserAddRows="False" CanUserResizeRows="False" CanUserResizeColumns="True" FontFamily="Arial" FontSize="12"  Width="1380">
                                    <DataGrid.Columns>
                                        <DataGridTemplateColumn  Width="60">
                                            <DataGridTemplateColumn.HeaderTemplate >
                                                <DataTemplate>
                                                    <TextBlock Text="{lex:Loc ID_TXT_Visible}" FontFamily="Arial" FontSize="12" VerticalAlignment="Bottom" Margin="3,0,0,0"/>
                                                </DataTemplate>
                                            </DataGridTemplateColumn.HeaderTemplate>
                                            <DataGridTemplateColumn.CellTemplate>
                                                <DataTemplate>
                                                    <CheckBox IsChecked="{Binding IsVisible, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center"/>
                                                </DataTemplate>
                                            </DataGridTemplateColumn.CellTemplate>
                                        </DataGridTemplateColumn>
                                        <DataGridTemplateColumn 
                                            lex:ResxLocalizationProvider.DefaultDictionary="lang_datalogviews"
                                            Header="{lex:Loc ID_TXT_Mark}" MinWidth="100">
                                            <DataGridTemplateColumn.CellTemplate>
                                                <DataTemplate>
                                                    <TextBlock Text="{Binding ProcessGuid}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                                </DataTemplate>
                                            </DataGridTemplateColumn.CellTemplate>
                                        </DataGridTemplateColumn>
                                        <DataGridTemplateColumn
                                            lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
                                            Header="{lex:Loc ID_TXT_Recipe}" MinWidth="150">
                                            <DataGridTemplateColumn.CellTemplate>
                                                <DataTemplate>
                                                    <TextBlock Text="{Binding RecipeName}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                                </DataTemplate>
                                            </DataGridTemplateColumn.CellTemplate>
                                        </DataGridTemplateColumn>
                                        <DataGridTemplateColumn
                                            lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
                                            Header="{lex:Loc ID_TXT_Date}" MinWidth="150">
                                            <DataGridTemplateColumn.CellTemplate>
                                                <DataTemplate>
                                                    <TextBlock Text="{Binding Time}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                                </DataTemplate>
                                            </DataGridTemplateColumn.CellTemplate>
                                        </DataGridTemplateColumn>
                                        <DataGridTemplateColumn
                                            lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
                                            Header="{lex:Loc ID_TXT_Color}" MinWidth="60">
                                            <DataGridTemplateColumn.CellTemplate>
                                                <DataTemplate>
                                                    <Button Style="{DynamicResource Color_Button}" Height="25" HorizontalAlignment="Stretch" Background="{Binding Stroke, Converter={StaticResource colorConverter}}" Width="50">
                                                        <i:Interaction.Triggers>
                                                            <i:EventTrigger EventName="Click">
                                                                <micro:ActionMessage MethodName="SelectColor">
                                                                    <micro:Parameter Value="{Binding}" ></micro:Parameter>
                                                                </micro:ActionMessage>
                                                            </i:EventTrigger>
                                                        </i:Interaction.Triggers>
                                                    </Button>
                                                </DataTemplate>
                                            </DataGridTemplateColumn.CellTemplate>
                                        </DataGridTemplateColumn>
                                        <DataGridTemplateColumn
                                            lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
                                            Header="{lex:Loc ID_TXT_Factor}" MinWidth="60">
                                            <DataGridTemplateColumn.CellTemplate>
                                                <DataTemplate>
                                                    <controls:TextBoxEx AllowBackgroundChange="False" Text="{Binding DataFactor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="50" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                                </DataTemplate>
                                            </DataGridTemplateColumn.CellTemplate>
                                        </DataGridTemplateColumn>
                                        <DataGridTemplateColumn
                                            lex:ResxLocalizationProvider.DefaultDictionary="lang_datalogviews"
                                            Header="{lex:Loc ID_TXT_YOffset}" MinWidth="100">
                                            <DataGridTemplateColumn.CellTemplate>
                                                <DataTemplate>
                                                    <TextBox Text="{Binding DataOffset, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="80" Margin="5,0" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                                </DataTemplate>
                                            </DataGridTemplateColumn.CellTemplate>
                                        </DataGridTemplateColumn>
                                        <DataGridTemplateColumn
                                            lex:ResxLocalizationProvider.DefaultDictionary="lang_datalogviews"
                                            Header="{lex:Loc ID_TXT_XOffset}" MinWidth="100">
                                            <DataGridTemplateColumn.CellTemplate>
                                                <DataTemplate>
                                                    <TextBox Text="{Binding DataXOffset, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="80" Margin="5,0" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                                </DataTemplate>
                                            </DataGridTemplateColumn.CellTemplate>
                                        </DataGridTemplateColumn>
                                        <DataGridTemplateColumn
                                            lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
                                            Header="{lex:Loc ID_TXT_Width}" MinWidth="60">
                                            <DataGridTemplateColumn.CellTemplate>
                                                <DataTemplate>
                                                    <controls:TextBoxEx AllowBackgroundChange="False" Text="{Binding LineThickness, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="50" Margin="5,0" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                                </DataTemplate>
                                            </DataGridTemplateColumn.CellTemplate>
                                        </DataGridTemplateColumn>
                                        <DataGridTemplateColumn  Width="60">
                                            <DataGridTemplateColumn.HeaderTemplate >
                                                <DataTemplate>
                                                    <TextBlock
                                                        lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
                                                        Text="{lex:Loc ID_TXT_Select}" FontFamily="Arial" FontSize="12" VerticalAlignment="Bottom" Margin="3,0,0,0"/>
                                                </DataTemplate>
                                            </DataGridTemplateColumn.HeaderTemplate>
                                            <DataGridTemplateColumn.CellTemplate>
                                                <DataTemplate>
                                                    <CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center"/>
                                                </DataTemplate>
                                            </DataGridTemplateColumn.CellTemplate>
                                        </DataGridTemplateColumn>
                                    </DataGrid.Columns>
                                </DataGrid>
                            </Grid>
                        </TabItem>
                    </TabControl>
                </Grid>
            </Grid>
        </Grid>
    </Grid>
</UserControl>
