liuwf 5 months ago
parent 5f36b558fe
commit d7df1a4240

@ -16,6 +16,39 @@
<Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="18"/> <Setter Property="FontSize" Value="18"/>
</Style> </Style>
<!-- 定义样式 -->
<Style x:Key="CustomDatePicker" TargetType="DatePicker">
<!-- 设置背景颜色 -->
<Setter Property="Background" Value="LightBlue"></Setter>
<!-- 设置边框颜色 -->
<Setter Property="BorderBrush" Value="DarkBlue"></Setter>
<!-- 设置字体样式 -->
<Setter Property="FontSize" Value="14"></Setter>
<!-- 设置前景色(文本颜色) -->
<Setter Property="Foreground" Value="Black"></Setter>
<!-- 设置日历的样式 -->
<Setter Property="CalendarStyle" Value="{StaticResource CustomCalendarStyle}"></Setter>
</Style>
<!-- 定义日历的样式 -->
<Style x:Key="CustomCalendarStyle" TargetType="Calendar">
<!-- 设置背景颜色 -->
<Setter Property="Background" Value="White"></Setter>
<!-- 设置边框颜色 -->
<Setter Property="BorderBrush" Value="Blue"></Setter>
<Setter Property="Width" Value="250"></Setter>
<Setter Property="Height" Value="250"></Setter>
<!-- 设置字体样式 -->
<Setter Property="FontSize" Value="12"></Setter>
</Style>
<Style TargetType="DataGrid"> <Style TargetType="DataGrid">
<!--网格线颜色--> <!--网格线颜色-->
<Setter Property="CanUserResizeColumns" Value="false"/> <Setter Property="CanUserResizeColumns" Value="false"/>
@ -94,10 +127,11 @@
<RowDefinition Height="8*"/> <RowDefinition Height="8*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<WrapPanel Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center"> <WrapPanel Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center">
<TextBlock Text="开始时间" Margin="10 0" Foreground="White" FontSize="20" VerticalAlignment="Center"/> <TextBlock Text="开始时间" Margin="10 0" Foreground="White" FontSize="18" VerticalAlignment="Center"/>
<DatePicker
x:Name="BeginTime" FontSize="18" <DatePicker Style="{StaticResource CustomDatePicker}"
Width="200" Margin="10 0" BorderBrush="White" x:Name="BeginTime" FontSize="18" FontFamily="Arial"
Width="170" Margin="5 0" BorderBrush="White"
materialDesign:CalendarAssist.IsHeaderVisible="False"> materialDesign:CalendarAssist.IsHeaderVisible="False">
<DatePicker.SelectedDate> <DatePicker.SelectedDate>
<Binding <Binding
@ -107,12 +141,13 @@
</Binding.ValidationRules> </Binding.ValidationRules>
</Binding> </Binding>
</DatePicker.SelectedDate> </DatePicker.SelectedDate>
</DatePicker> </DatePicker>
<TextBlock Text="结束时间" Margin="10 0" Foreground="White" FontSize="20" VerticalAlignment="Center"/> <TextBlock Text="结束时间" Margin="10 0" Foreground="White" FontSize="20" VerticalAlignment="Center"/>
<DatePicker <DatePicker Style="{StaticResource CustomDatePicker}"
x:Name="EndTime" Margin="10 0" x:Name="EndTime" Margin="10 0"
Width="200" BorderBrush="White" FontSize="18" Width="170" BorderBrush="White" FontSize="18"
materialDesign:CalendarAssist.IsHeaderVisible="False"> materialDesign:CalendarAssist.IsHeaderVisible="False">
<DatePicker.SelectedDate> <DatePicker.SelectedDate>
<Binding <Binding
@ -161,7 +196,7 @@
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>
<DataGridTextColumn Binding="{Binding ProductCode}" Header="箱体码" Width="2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding ProductCode}" Header="产品条码" Width="2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialType}" Header="产品型号" Width="2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" /> <DataGridTextColumn Binding="{Binding MaterialType}" Header="产品型号" Width="2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Binding="{Binding MaterialName}" Header="产品名称" Width="2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" /> <DataGridTextColumn Binding="{Binding MaterialName}" Header="产品名称" Width="2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Binding="{Binding isChecked, Converter={StaticResource IsCheckedConverter}}" Header="是否检测" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" /> <DataGridTextColumn Binding="{Binding isChecked, Converter={StaticResource IsCheckedConverter}}" Header="是否检测" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />

Loading…
Cancel
Save