<Window x:Class="Khd.Core.Wpf.WindowPage.HoistWarnInfoWindow"
        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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
        xmlns:local="clr-namespace:Khd.Core.Wpf.WindowPage"
        xmlns:localConverter="clr-namespace:Khd.Core.Wpf.myConverter"
        mc:Ignorable="d"
        Title="提升机报警记录" Height="1080" Width="1880" WindowStartupLocation="CenterScreen"  Background="#172557">

    <Window.Resources>



        <ResourceDictionary>

            <!-- 定义样式 -->
            <Style x:Key="CustomDatePicker" TargetType="DatePicker">

                <!-- 设置背景颜色 -->
                <Setter Property="Background" Value="LightBlue"></Setter>
                <!-- 设置边框颜色 -->
                <Setter Property="BorderBrush" Value="DarkBlue"></Setter>
                <!-- 设置字体样式 -->
                <Setter Property="FontSize" Value="20"></Setter>
                <!-- 设置前景色（文本颜色） -->
                <Setter Property="Foreground" Value="Black"></Setter>


            </Style>


            <!-- 定义日历的样式 -->
            <Style x:Key="CustomCalendarStyle" TargetType="Calendar">
                <!-- 设置背景颜色 -->
                <Setter Property="Background" Value="White"></Setter>
                <!-- 设置边框颜色 -->
                <Setter Property="BorderBrush" Value="Blue"></Setter>

                <Setter Property="Width" Value="350"></Setter>
                <Setter Property="Height" Value="250"></Setter>
                <!-- 设置字体样式 -->
                <Setter Property="FontSize" Value="16"></Setter>
            </Style>

            <Style x:Key="XingHaoBianMaYangShi" TargetType="{x:Type TextBox}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="TextBox">
                            <Border BorderThickness="1" BorderBrush="Gray" CornerRadius="8" Background="{TemplateBinding Background}">
                                <ScrollViewer x:Name="PART_ContentHost" VerticalAlignment="Center"  BorderThickness="0" IsTabStop="False"></ScrollViewer>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="VerticalContentAlignment" Value="Center"></Setter>
                <Setter Property="HorizontalContentAlignment" Value="Left"></Setter>
            </Style>

            <localConverter:TypeDataConverter x:Key="taskTypeConverter"/>
            <localConverter:EquipConverter x:Key="EquipConverter"/>
            <localConverter:AgvTaskStatusConverter x:Key="AgvTaskStatusConverter"/>


            <Style x:Key="dgCell" TargetType="TextBlock" BasedOn="{x:Null}">
                <Setter Property="TextAlignment" Value="Center" />
                <Setter Property="HorizontalAlignment" Value="Center" />
                <Setter Property="VerticalAlignment" Value="Center" />
            </Style>

            <ResourceDictionary.MergedDictionaries>
                <!--<hc:ThemeResources/>
                 <hc:Theme/>-->
                <ResourceDictionary Source="/CSS/SearchBtnClass.xaml" />
                <ResourceDictionary Source="/CSS/SearchTextClass.xaml" />
                <ResourceDictionary Source="/CSS/DataGridClass.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

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

        <Grid Grid.Row="0">

            <WrapPanel HorizontalAlignment="Left" VerticalAlignment="Center">
                <TextBlock Text="开始时间"   Margin="10 0" Foreground="White" FontSize="20"  VerticalAlignment="Center"/>

                <DatePicker  Style="{StaticResource CustomDatePicker}" CalendarStyle="{StaticResource CustomCalendarStyle}"
                            x:Name="BeginTime" FontSize="20"  
                            Width="170"  Margin="10 0"  BorderBrush="White"
                            materialDesign:CalendarAssist.IsHeaderVisible="False">
                    <!--<DatePicker.SelectedDate >
                        <Binding
                                        Path="BeginDate"
                                        UpdateSourceTrigger="PropertyChanged">
                            <Binding.ValidationRules>
                            </Binding.ValidationRules>
                        </Binding>
                    </DatePicker.SelectedDate>-->

                </DatePicker>

                <TextBlock Text="结束时间" Margin="10 0" Foreground="White" FontSize="20"  VerticalAlignment="Center"/>
                <DatePicker  Style="{StaticResource CustomDatePicker}"
            x:Name="EndTime"  Margin="10 0"  
            Width="170"  BorderBrush="White" FontSize="20"
            materialDesign:CalendarAssist.IsHeaderVisible="False"
            CalendarStyle="{StaticResource CustomCalendarStyle}">
                    <!-- 添加这一行 -->
                    <!--<DatePicker.SelectedDate>
                        <Binding
                        Path="EndDate"
                        UpdateSourceTrigger="PropertyChanged">
                            <Binding.ValidationRules>
                            </Binding.ValidationRules>
                        </Binding>
                    </DatePicker.SelectedDate>-->
                </DatePicker>

                <Button Margin="10 0"
                            Content="时间查询" x:Name="SelectByTime"
                            Background="LimeGreen" Width="100" Height="40" FontSize="20" Click="SelectByTime_Click">

                </Button>
            </WrapPanel>
        </Grid>
        <Grid Grid.Row="1">
            <Grid   Margin="0,5,0,0" HorizontalAlignment="Left">

                <Grid Background="#172557" Grid.Row="1" ></Grid>
                <Grid Grid.Row="2">
                    <DataGrid 
                            x:Name="LoadMaterial0"            
                            AlternationCount="2"
                            AutoGenerateColumns="False"
                            Background="#172557"
                            CanUserAddRows="False"
                            CanUserReorderColumns="False"
                            CanUserResizeColumns="False"
                            CanUserResizeRows="False"
                            Focusable="False"
                            HeadersVisibility="Column"
                            IsReadOnly="True"
                            
                            LoadingRow="dgData_LoadingRow"
                            RowHeaderWidth="0"
                            SelectionMode="Single" FontSize="16" HorizontalAlignment="Left" >
                        <DataGrid.Columns>

                            <DataGridTemplateColumn
                                    x:Name="orderControlData0"
                                    Width="100"
                                    MinWidth="10"
                                    Header=" 序号"
                                    IsReadOnly="True">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock
                                                Margin="0"
                                                HorizontalAlignment="Center"
                                                VerticalAlignment="Center"
                                                Focusable="False"
                                                FontSize="20"
                                                Text="{Binding Header, RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}, Mode=FindAncestor}}" />
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>
                            <DataGridTextColumn
                                    Width="400*"
                                    Binding="{Binding AlarmData}"
                                    CanUserSort="False"
                                    ElementStyle="{StaticResource dgCell}"
                                    FontSize="20"
                                    Header="报警信息"
                                    IsReadOnly="True" />

                            <DataGridTextColumn
                                    Width="250*"
                                    Binding="{Binding HandleSuggest}"
                                    CanUserSort="False"
                                    ElementStyle="{StaticResource dgCell}"
                                    FontSize="20"
                                    Header="处理建议"
                                    IsReadOnly="True" />
                            <DataGridTextColumn
                                    Width="100*"
                                    Binding="{Binding AlarmStatus}"
                                    CanUserSort="False"
                                    ElementStyle="{StaticResource dgCell}"
                                    FontSize="20"
                                    Header="处理状态"
                                    IsReadOnly="True" />

                            <DataGridTextColumn
                                    Width="140*"
                                    Binding="{Binding CreateTime,StringFormat='{}{0:yyyy-MM-dd HH:mm:ss}'}"
                                    CanUserSort="False"
                                    ElementStyle="{StaticResource dgCell}"
                                    FontSize="20"
                                    Header="报警时间"
                                    IsReadOnly="True" />
                         

                        </DataGrid.Columns>
                        <DataGrid.CellStyle>
                            <Style TargetType="{x:Type DataGridCell}">
                                <Setter Property="Background" Value="#213269" />
                                <Setter Property="Foreground" Value="White" />
                                <Setter Property="Height" Value="50" />
                                <Setter Property="HorizontalContentAlignment" Value="Center" />
                            </Style>

                        </DataGrid.CellStyle>
                        <DataGrid.RowStyle>
                            <Style TargetType="{x:Type DataGridRow}">
                                <Setter Property="Background" Value="#213269" />
                                <Setter Property="Foreground" Value="White" />
                                <Setter Property="Height" Value="50" />
                            </Style>
                        </DataGrid.RowStyle>
                        <DataGrid.RowHeaderStyle>
                            <Style TargetType="{x:Type DataGridRowHeader}">
                                <Setter Property="Background" Value="#213269" />
                                <Setter Property="Foreground" Value="White" />
                                <Setter Property="Height" Value="50" />
                                <Setter Property="HorizontalContentAlignment" Value="Center" />
                            </Style>
                        </DataGrid.RowHeaderStyle>
                        <DataGrid.ColumnHeaderStyle>
                            <Style TargetType="{x:Type DataGridColumnHeader}">
                                <Setter Property="Background" Value="#172560" />
                                <Setter Property="Foreground" Value="White" />
                                <Setter Property="Height" Value="50" />
                                <Setter Property="HorizontalContentAlignment" Value="Center" />
                                <Setter Property="Margin" Value="0,0,0,0" />
                                <Setter Property="BorderThickness" Value="5" />
                                <Setter Property="BorderBrush" Value="#172540" />
                                <Setter Property="FontSize" Value="30" />
                            </Style>
                        </DataGrid.ColumnHeaderStyle>
                    </DataGrid>
                </Grid>
            </Grid>
        </Grid>
    </Grid>

</Window>
