change-样式

dev
liuwf 1 year ago
parent 0615572185
commit 23f3ad66c7

@ -1,8 +1,9 @@
<Window x:Class="Aucma.Core.BoxFoam.Views.UserPage.SelectType"
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="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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d" FontFamily="Microsoft YaHei"
Name="window" Background="#1254AB" d:DesignHeight="800" d:DesignWidth="1200">
<Window.Resources>
@ -19,6 +20,68 @@
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false" />
<Setter Property="SmallChange" Value="1" />
</Style>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
<!--<Setter Property="Height" Value="40"/>-->
<Setter Property="FontSize" Value="16"/>
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="HorizontalAlignment" Value="Left" />
</Style>
<Style TargetType="DataGrid">
<!--网格线颜色-->
<Setter Property="CanUserResizeColumns" Value="false"/>
<Setter Property="Background" Value="#1152AC" />
<Setter Property="BorderBrush" Value="#4285DE" />
<Setter Property="Foreground" Value="White"/>
<Setter Property="HorizontalGridLinesBrush">
<Setter.Value>
<SolidColorBrush Color="#4285DE"/>
</Setter.Value>
</Setter>
<Setter Property="VerticalGridLinesBrush">
<Setter.Value>
<SolidColorBrush Color="#1152AC"/>
</Setter.Value>
</Setter>
</Style>
<!--列头标题栏样式-->
<Style TargetType="DataGridColumnHeader">
<!--<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>-->
<!--<Setter Property="Background" Value="#dddddd"/>
<Setter Property="Foreground" Value="Black"/>-->
<!--<Setter Property="BorderThickness" Value="1" />-->
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="BorderBrush" Value="#dddddd" />
<Setter Property="Height" Value="48"/>
<Setter Property="FontSize" Value="18"/>
<Setter Property="Background" Value="#4285DE"/>
<Setter Property="Foreground" Value="White"/>
</Style>
<!--单元格样式-->
<Style TargetType="DataGridCell">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="BorderBrush" Value="Gray" />
<Setter Property="Height" Value="40"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Grid Background="{TemplateBinding Background}" >
<ContentPresenter HorizontalAlignment="Left" VerticalAlignment="Center" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#4285DE"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Border Margin="5" Background="#1254AB" CornerRadius="1">
@ -40,17 +103,15 @@
<Button Content="清除型号" Command="{Binding deleteCommand}" Background="#FF9900" Foreground="white" BorderBrush="#FF9900" VerticalAlignment="Center" Height="30" Width="100" />
</StackPanel>
<!--计划列表-->
<Border Grid.Row="1" Grid.Column="0" BorderBrush="#1254AB" Background="Transparent" BorderThickness="0" CornerRadius="5" Margin="1,1,5,5" >
<DataGrid ItemsSource="{Binding MaterialDataGrid}" Background="Transparent"
FontSize="18" ColumnHeaderHeight="35"
RowHeight="40" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False"
Foreground="#FFFFFF" SelectedItem="{Binding SelectedDataItem}" SelectionChanged="DataGrid_SelectionChanged">
<Border Grid.Row="1" Grid.Column="0" BorderThickness="0" CornerRadius="5" Margin="1,1,5,5" >
<DataGrid ItemsSource="{Binding MaterialDataGrid}" Height="{Binding Path=ActualHeight, ElementName=HeightPanel}"
HorizontalAlignment="Left" VerticalAlignment="Top" AlternationCount="2" RowHeaderWidth="0"
ColumnWidth="*" AutoGenerateColumns="False" IsReadOnly="True" CanUserAddRows="False" SelectionMode="Single"
SelectedItem="{Binding SelectedDataItem}" SelectionChanged="DataGrid_SelectionChanged">
<!--resourceStyle 399行修改选中字体颜色-->
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding MaterialCode}" Header="产品编码" Width="1*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding MaterialName}" Header="产品名称" Width="2.5*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding MaterialCode}" Width="*" Header="产品编码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialName}" Width="2*" Header="产品名称" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
</DataGrid.Columns>
</DataGrid>
@ -71,14 +132,15 @@
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal" VerticalAlignment="Center" Margin="50,0,0,0">
<TextBlock Text="产品编码:" FontSize="20" Foreground="#FFFFFF" Margin="10,0,0,0"/>
<TextBox x:Name="MaterialCode" FontSize="20" Text="{Binding PlanInfo.MaterialCode}" Foreground="#FFFFFF" Width="260" IsReadOnly="True" Margin="5,0,10,0"/>
<TextBlock Text="产品编码:" FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" />
<TextBox x:Name="MaterialCode" Text="{Binding PlanInfo.MaterialCode}" Foreground="white" BorderBrush="White" IsReadOnly="True" Margin="15 0 0 0 " FontSize="18" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" Width="350"/>
</StackPanel>
<StackPanel Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center" Margin="50,0,0,0">
<TextBlock Text="产品型号:" FontSize="20" Foreground="#FFFFFF" Margin="10,0,0,0"/>
<TextBox x:Name="MaterialName" FontSize="20" Text="{Binding PlanInfo.MaterialName}" Foreground="#FFFFFF" Width="350" IsReadOnly="True" Margin="5,0,10,0"/>
<TextBlock Text="产品型号:" FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox x:Name="MaterialName" Text="{Binding PlanInfo.MaterialName}" Foreground="white" BorderBrush="White" IsReadOnly="True" Margin="15 0 0 0 " FontSize="18" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" Width="350"/>
</StackPanel>
<StackPanel Grid.Row="2" Orientation="Horizontal" VerticalAlignment="Center" Margin="60,0,0,0" >
<!--单选框样式-->
@ -114,9 +176,9 @@
</Style>
</StackPanel.Resources>
<TextBlock Text="选择型号: " FontSize="20" Foreground="#FFFFFF" />
<RadioButton Content="型号1" GroupName="Direction" IsChecked="{Binding IsSelectedOptionA, Mode=TwoWay}" />
<RadioButton Content="型号2" GroupName="Direction" IsChecked="{Binding IsSelectedOptionB, Mode=TwoWay}" Margin="10 0 0 0"/>
<TextBlock Text="选择型号: " FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" />
<RadioButton Content="型号1" GroupName="Direction" IsChecked="{Binding IsSelectedOptionA, Mode=TwoWay}" Foreground="white" BorderBrush="White" Margin="15 0 0 0 " FontSize="18" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" />
<RadioButton Content="型号2" GroupName="Direction" IsChecked="{Binding IsSelectedOptionB, Mode=TwoWay}" Foreground="white" BorderBrush="White" Margin="15 0 0 0 " FontSize="18" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" />
<!--<RadioButton Content="型号3" GroupName="Direction" IsChecked="{Binding IsSelectedOptionC, Mode=TwoWay}" Margin="10 0 0 0"/>-->
</StackPanel>

Loading…
Cancel
Save