<Window x:Class="NEIntelligentControl2.Windows.HistoryDataWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:NEIntelligentControl2.Windows"
             xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
        mc:Ignorable="d"
        Title="历史数据" Height="727" Width="1200" WindowStartupLocation="CenterScreen" Loaded="Window_Loaded">
    <Window.Resources>
        <Style x:Key="ConfirmButtonStyle" TargetType="{x:Type Button}">
            <Setter Property="Background" Value="#FF006ACC"/>
            <Setter Property="Foreground" Value="WhiteSmoke"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Padding" Value="17,6"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="Margin" Value="20,0"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true" CornerRadius="3">
                            <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Background" TargetName="border" Value="#FF2E81CC"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter Property="Background" TargetName="border" Value="#FF006ACC"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <WrapPanel Margin="5">
            <StackPanel Orientation="Horizontal" Margin="5">
                <TextBlock Text="开始时间："/>
                <TextBox Margin="5,0,0,0" x:Name="_TBStart" MinWidth="120" KeyDown="TextBox_KeyDown"/>
            </StackPanel>
            <StackPanel Orientation="Horizontal" Margin="5">
                <TextBlock Text="结束时间："/>
                <TextBox Margin="5,0,0,0" x:Name="_TBEnd" MinWidth="120" KeyDown="TextBox_KeyDown"/>
            </StackPanel>


            <StackPanel Orientation="Horizontal" Margin="5" VerticalAlignment="Center">
                <TextBlock Text="快照间隔：" VerticalAlignment="Center"/>
                <RadioButton Content="一分钟" GroupName="interval" Tag="1" Click="RadioButton_Click" Margin="3"/>
                <RadioButton Content="五分钟" GroupName="interval" IsChecked="True" Tag="5" Margin="3" Click="RadioButton_Click"/>
                <RadioButton Content="十分钟" GroupName="interval"  Tag="10" Click="RadioButton_Click" Margin="3"/>
                <RadioButton Content="原始值" Visibility="Collapsed" GroupName="interval"  Tag="0" Click="RadioButton_Click" Margin="3"/>
            </StackPanel>

            <Button Content="查 询" Margin="5,0" Style="{DynamicResource ConfirmButtonStyle}" VerticalAlignment="Center" Click="Button_Click" Tag="search"/>
            <Button Content="数据导出" Margin="5,0" Style="{DynamicResource ConfirmButtonStyle}" VerticalAlignment="Center" Click="Button_Click" Tag="output"/>
        </WrapPanel>
        <lvc:CartesianChart x:Name="_Chart" Margin="5" Grid.Row="1" LegendLocation="Bottom" Foreground="#FF525252" DisableAnimations="True">
            <lvc:CartesianChart.AxisX>
                <lvc:Axis x:Name="_ChartAxisX" Foreground="#FF525252">
                    <lvc:Axis.Separator>
                        <lvc:Separator Stroke="{x:Null}"/>
                    </lvc:Axis.Separator>
                </lvc:Axis>
            </lvc:CartesianChart.AxisX>
            <lvc:CartesianChart.AxisY>
                <lvc:Axis Foreground="#FF525252">
                    <lvc:Axis.Separator>
                        <lvc:Separator Stroke="#FFE2E2E2"/>
                    </lvc:Axis.Separator>
                </lvc:Axis>
            </lvc:CartesianChart.AxisY>

            <lvc:CartesianChart.DataTooltip>
                <lvc:DefaultTooltip Background="#CCDEDEDE" CornerRadius="7"/>
            </lvc:CartesianChart.DataTooltip>

            <lvc:CartesianChart.Series>
                <lvc:LineSeries Title="" x:Name="_LSLine" PointForeground="Transparent" Stroke="#FF31B9FB" Fill="Transparent" PointGeometry="{x:Null}" StrokeThickness="1.2"/>
            </lvc:CartesianChart.Series>
        </lvc:CartesianChart>

        <StatusBar Grid.Row="2">
            
        </StatusBar>
    </Grid>
</Window>
