<Page x:Class="头罩视野.Views.RecordDate"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:local="clr-namespace:头罩视野.Views"
      mc:Ignorable="d" 
     d:DesignHeight="768" d:DesignWidth="1024"
 Background="#F5F7FA"
      Title="RecordDate" Loaded="Page_Loaded" Unloaded="Page_Unloaded">

    <Page.Resources>
        <!-- 标题样式 -->
        <Style x:Key="MainTitleStyle" TargetType="TextBlock">
            <Setter Property="FontSize" Value="28"/>
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="Foreground" Value="#2C3E50"/>
            <Setter Property="HorizontalAlignment" Value="Center"/>
            <Setter Property="Margin" Value="0,15,0,15"/>
        </Style>

        <!-- DataGrid 样式 -->
        <Style x:Key="DataGridStyle" TargetType="DataGrid">
            <Setter Property="Background" Value="#FFFFFF"/>
            <Setter Property="BorderBrush" Value="#E5E8E8"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="GridLinesVisibility" Value="Horizontal"/>
            <Setter Property="HorizontalGridLinesBrush" Value="#ECF0F1"/>
            <Setter Property="VerticalGridLinesBrush" Value="#ECF0F1"/>
            <Setter Property="HeadersVisibility" Value="Column"/>
            <Setter Property="CanUserAddRows" Value="False"/>
            <Setter Property="CanUserDeleteRows" Value="False"/>
            <Setter Property="AutoGenerateColumns" Value="False"/>
            <Setter Property="IsReadOnly" Value="True"/>
            <Setter Property="SelectionMode" Value="Single"/>
            <Setter Property="SelectionUnit" Value="FullRow"/>
            <Setter Property="RowHeight" Value="36"/>
            <Setter Property="FontSize" Value="13"/>
            <Setter Property="Foreground" Value="#2C3E50"/>
            <Setter Property="ScrollViewer.CanContentScroll" Value="True"/>
            <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
            <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        </Style>

        <!-- DataGrid 列头样式 -->
        <Style x:Key="DataGridColumnHeaderStyle" TargetType="DataGridColumnHeader">
            <Setter Property="Background" Value="#E5E5E5"/>
            <Setter Property="Foreground" Value="Black"/>
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="Height" Value="40"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Padding" Value="10,8"/>
            <Setter Property="BorderBrush" Value="#E5E5E5"/>
            <Setter Property="BorderThickness" Value="0,0,1,0"/>
        </Style>

        <!-- DataGrid 行样式 -->
        <Style x:Key="DataGridRowStyle" TargetType="DataGridRow">
            <Setter Property="Background" Value="White"/>
            <Style.Triggers>
                <!-- 斑马线效果 -->
                <Trigger Property="AlternationIndex" Value="0">
                    <Setter Property="Background" Value="#FFFFFF"/>
                </Trigger>
                <Trigger Property="AlternationIndex" Value="1">
                    <Setter Property="Background" Value="#F8F9F9"/>
                </Trigger>
                <!-- 鼠标悬停效果 -->
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="#EBF5FB"/>
                </Trigger>
                <!-- 选中效果 -->
                <Trigger Property="IsSelected" Value="True">
                    <Setter Property="Background" Value="#D6EAF8"/>
                    <Setter Property="BorderBrush" Value="#3498DB"/>
                    <Setter Property="BorderThickness" Value="1"/>
                </Trigger>
            </Style.Triggers>
        </Style>

        <!-- DataGrid 单元格样式 -->
        <Style x:Key="DataGridCellStyle" TargetType="DataGridCell">
            <Setter Property="BorderBrush" Value="#ECF0F1"/>
            <Setter Property="BorderThickness" Value="0,0,1,1"/>
            <Setter Property="Padding" Value="10,8"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="TextBlock.TextAlignment" Value="Center"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="DataGridCell">
                        <Border BorderBrush="{TemplateBinding BorderBrush}" 
                                BorderThickness="{TemplateBinding BorderThickness}" 
                                Background="{TemplateBinding Background}" 
                                Padding="{TemplateBinding Padding}"
                                SnapsToDevicePixels="True">
                            <ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="TabButtonStyle" TargetType="Button">
            <Setter Property="Background" Value="#3498DB"/>
            <Setter Property="FontSize" Value="20"/>
            <Setter Property="Foreground" Value="#fff"/>
            <Setter Property="Height" Value="70"/>
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="BorderBrush" Value="#fff"/>
        </Style>


    </Page.Resources>
    <Grid Margin="10">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>

        </Grid.RowDefinitions>

        <!-- 顶部标题栏 -->
        <Grid Grid.Row="0" Margin="0 0 0 10">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>

            <TextBlock Grid.Column="2" Style="{StaticResource MainTitleStyle}" Text="数据记录" 
           HorizontalAlignment="Center" VerticalAlignment="Center"/>
           
        </Grid>
        <Grid Grid.Row="1">
            <TextBlock Text="左眼" FontSize="16" Margin="0,0,0,5"/>
        </Grid>
        <!--表格1-->
        <Grid Grid.Row="2" Margin="0 0 0 10">
            <DataGrid x:Name="dataGrid1"
                       Height="190" 
         ScrollViewer.VerticalScrollBarVisibility="Auto"
         ScrollViewer.HorizontalScrollBarVisibility="Auto"
          AutoGenerateColumns="False"   
            CanUserAddRows="False"
            IsReadOnly="True"
            HeadersVisibility="Column"
            GridLinesVisibility="All"           
            Style="{StaticResource DataGridStyle}"
            AlternationCount="2"
            ColumnHeaderStyle="{StaticResource DataGridColumnHeaderStyle}"
            RowStyle="{StaticResource DataGridRowStyle}"
            CellStyle="{StaticResource DataGridCellStyle}"
        >

                <!-- 表格列（你要的 6 列） -->
                <DataGrid.Columns>
                    <DataGridTextColumn Header="编号" Binding="{Binding Id}" Width="60"/>
                    <DataGridTextColumn Header="时间" Binding="{Binding Time}" Width="120"/>
                    <DataGridTextColumn Header="日期" Binding="{Binding Date}" Width="120"/>
                   
                </DataGrid.Columns>
            </DataGrid>
            
        </Grid>
        <Grid Grid.Row="3">
            <TextBlock Text="右眼" FontSize="16" Margin="0,10,0,5"/>
            <Button Content="保存" FontSize="18"
Width="120" Height="50" Background="#3498DB"  Foreground="White" HorizontalAlignment="Left" Margin="850,0,0,5"  Click="btnSaveLeft_Click" />
        </Grid>
        <!--表格2-->
        <Grid Grid.Row="4" Margin="0 0 0 10">
            <DataGrid x:Name="dataGrid2"
                                    Height="190" 
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
                  AutoGenerateColumns="False"   
                    CanUserAddRows="False"
                    IsReadOnly="True"
                    HeadersVisibility="Column"
                    GridLinesVisibility="All"           
                    Style="{StaticResource DataGridStyle}"
                  
                    AlternationCount="2"
                    ColumnHeaderStyle="{StaticResource DataGridColumnHeaderStyle}"
                    RowStyle="{StaticResource DataGridRowStyle}"
                    CellStyle="{StaticResource DataGridCellStyle}"
                >

                <!-- 表格列（你要的 6 列） -->
                <DataGrid.Columns>
                    <DataGridTextColumn Header="编号" Binding="{Binding Id}" Width="80"/>
                    <DataGridTextColumn Header="时间" Binding="{Binding Time}" Width="120"/>
                    <DataGridTextColumn Header="日期" Binding="{Binding Date}" Width="120"/>
                   
                </DataGrid.Columns>
            </DataGrid>
            
        </Grid>
        <!--按钮-->
        <Grid Grid.Row="5" >
            <!-- 停止 -->
            <Button Content="保存" FontSize="18"
         Width="120" Height="50" Background="#3498DB"  Foreground="White" HorizontalAlignment="Left" Margin="850,0,0,0"   Click="btnSaveRight_Click"/>
            <Button Content="清除" FontSize="18"
                Width="120" Height="50" Background="White"  BorderBrush="red" Foreground="red" HorizontalAlignment="Left" Margin="14,0,0,0" PreviewMouseLeftButtonDown ="btnClear_MouseDown" PreviewMouseLeftButtonUp ="btnClear_MouseUp"  />
            <TextBlock HorizontalAlignment="Left"  Foreground="red"
                       FontSize="18" 
                       Width="142" Margin="148,25,0,23" RenderTransformOrigin="0.5,0.5">
                <TextBlock.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform AngleY="-0.614"/>
                        <RotateTransform/>
                        <TranslateTransform Y="-0.739"/>
                    </TransformGroup>
                </TextBlock.RenderTransform><Run Language="zh-cn" Text="备注: 清除长按"/></TextBlock>
        </Grid>
        <!-- 底部导航栏 -->
        <Grid Grid.Row="6"   VerticalAlignment="Bottom">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <Button Style="{StaticResource TabButtonStyle}" Grid.Column="0" Content="主页" 
   Click="GoHome" />
            <Button Style="{StaticResource TabButtonStyle}" Grid.Column="1" Content="测试界面"
  Click="GoTest" />
            <Button Style="{StaticResource TabButtonStyle}" Grid.Column="2" Content="数据记录"
  Click="GoRecord" />
            <Button Style="{StaticResource TabButtonStyle}"  Grid.Column="3" Content="记录画面" 
Click="GoView" />
        </Grid>
    </Grid>
</Page>
