修改页面主题颜色风格

This commit is contained in:
MoYue 2024-04-29 19:07:08 +08:00
parent ddd1ea5887
commit c52b64532f

View File

@ -10,10 +10,10 @@
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
FontFamily="{StaticResource DigitalDisplay}" FontFamily="{StaticResource DigitalDisplay}"
FontSize="13" FontSize="13"
Foreground="#333" Foreground="White"
FontWeight="ExtraLight" FontWeight="ExtraLight"
Background="#FAFCFF" Background="#FAFCFF"
Title="原位实验室主控系统" Height="750" Width="1300"> Title="原位实验室主控系统" Height="800" Width="1400">
<WindowChrome.WindowChrome> <WindowChrome.WindowChrome>
<WindowChrome GlassFrameThickness="1" <WindowChrome GlassFrameThickness="1"
NonClientFrameEdges="None"/> NonClientFrameEdges="None"/>
@ -117,7 +117,7 @@
<DockPanel> <DockPanel>
<!--左侧菜单--> <!--左侧菜单-->
<Border BorderBrush="#EEE" BorderThickness="0,0,1,0"> <Border BorderBrush="#EEE" BorderThickness="0,0,1,0" >
<Grid Width="200" DockPanel.Dock="Left"> <Grid Width="200" DockPanel.Dock="Left">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="auto"/> <RowDefinition Height="auto"/>
@ -130,15 +130,14 @@
VerticalAlignment="Center" Foreground="#444" FontWeight="Normal" Margin="10,0"/> VerticalAlignment="Center" Foreground="#444" FontWeight="Normal" Margin="10,0"/>
</StackPanel> </StackPanel>
<TreeView Grid.Row="1" Background="Transparent" BorderThickness="0" <TreeView Grid.Row="1" Background="Transparent" BorderThickness="0" ItemsSource="{Binding Menus}">
ItemsSource="{Binding Menus}">
<TreeView.Resources> <TreeView.Resources>
<ControlTemplate TargetType="ToggleButton" x:Key="ArrowButtonTemplate"> <ControlTemplate TargetType="ToggleButton" x:Key="ArrowButtonTemplate">
<Grid Background="Transparent" Name="back"> <Grid Background="Transparent" Name="back">
<TextBlock Text="&#xe81d;" FontFamily="{StaticResource Icons}" <TextBlock Text="&#xe81d;" FontFamily="{StaticResource Icons}"
VerticalAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center"
RenderTransformOrigin="0.5,0.5" Name="arrow" RenderTransformOrigin="0.5,0.5" Name="arrow"
Foreground="{TemplateBinding Foreground}" Foreground="White"
FontSize="9"> FontSize="9">
</TextBlock> </TextBlock>
</Grid> </Grid>
@ -195,8 +194,6 @@
<ItemsPresenter x:Name="ItemsHost" Margin="18,0,0,0" Grid.ColumnSpan="2" Grid.Row="1" /> <ItemsPresenter x:Name="ItemsHost" Margin="18,0,0,0" Grid.ColumnSpan="2" Grid.Row="1" />
</Grid> </Grid>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="false"> <Trigger Property="IsExpanded" Value="false">
<Setter Property="Visibility" TargetName="ItemsHost" Value="Collapsed"/> <Setter Property="Visibility" TargetName="ItemsHost" Value="Collapsed"/>
@ -237,7 +234,7 @@
FontFamily="{StaticResource Icons}" FontFamily="{StaticResource Icons}"
VerticalAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center"
FontSize="15"/> FontSize="15"/>
<TextBlock Text="{Binding MenuHeader}" Grid.Column="1" Margin="5,0,0,0" FontSize="12" <TextBlock Text="{Binding MenuHeader}" Grid.Column="1" Margin="5,0,0,0" FontSize="15"
VerticalAlignment="Center"/> VerticalAlignment="Center"/>
</Grid> </Grid>
<HierarchicalDataTemplate.Triggers> <HierarchicalDataTemplate.Triggers>
@ -249,7 +246,6 @@
</TreeView.ItemTemplate> </TreeView.ItemTemplate>
</TreeView> </TreeView>
</Grid> </Grid>
</Border> </Border>
@ -260,12 +256,12 @@
<RowDefinition/> <RowDefinition/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Border Grid.Row="1" Background="#F0F6FB"/> <Border Grid.Row="1" Background="#F0F6FB" />
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left"
Margin="15,0"> Margin="15,0">
<Run Text="原位实验室主控系统" FontSize="14" FontWeight="ExtraBold"/> <Run Text="原位实验室主控系统" FontSize="15" FontWeight="ExtraBold"/>
<Run Text="v1.0" FontSize="11"/> <Run Text="v1.0" FontSize="13"/>
</TextBlock> </TextBlock>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" <StackPanel Orientation="Horizontal" VerticalAlignment="Center"
@ -280,7 +276,7 @@
</StackPanel.Resources> </StackPanel.Resources>
<!--时间和星期--> <!--时间和星期-->
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Row="2" Margin="37,0" FontSize="13" FontWeight="Normal" <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Row="2" Margin="37,0" FontSize="15" FontWeight="Normal"
Foreground="#555" DataContext="{x:Static sys:DateTime.Now}" Name="txt_time"> Foreground="#555" DataContext="{x:Static sys:DateTime.Now}" Name="txt_time">
<Run Text="{Binding Now,Mode=OneWay,StringFormat='yyyy年MM月dd日'}" Name="txt_date" DataContext="{x:Static sys:DateTime.Now}" /> <Run Text="{Binding Now,Mode=OneWay,StringFormat='yyyy年MM月dd日'}" Name="txt_date" DataContext="{x:Static sys:DateTime.Now}" />
<Run Text=" "/> <Run Text=" "/>
@ -310,7 +306,7 @@
<ToggleButton Content="{Binding CurrentUser.RealName}" <ToggleButton Content="{Binding CurrentUser.RealName}"
ContentStringFormat="Hi! {0}" ContentStringFormat="Hi! {0}"
VerticalAlignment="Center" VerticalAlignment="Center"
FontSize="11" FontWeight="Normal" Foreground="#888" FontSize="14" FontWeight="Normal" Foreground="White"
Margin="0,0,10,0" Name="tbtn_user" Margin="0,0,10,0" Name="tbtn_user"
Height="30" Height="30"
WindowChrome.IsHitTestVisibleInChrome="True" WindowChrome.IsHitTestVisibleInChrome="True"
@ -318,17 +314,17 @@
<!--最小化按钮--> <!--最小化按钮-->
<Button Content="&#xe7e6;" FontFamily="{StaticResource Icons}" <Button Content="&#xe7e6;" FontFamily="{StaticResource Icons}"
Style="{StaticResource ControlButtonStyle}" Style="{StaticResource ControlButtonStyle}" Foreground="White"
Click="Button_MinClick"/> Click="Button_MinClick"/>
<!--最大化按钮--> <!--最大化按钮-->
<Button Content="&#xe694;" FontFamily="{StaticResource Icons}" <Button Content="&#xe694;" FontFamily="{StaticResource Icons}"
Style="{StaticResource ControlButtonStyle}" Style="{StaticResource ControlButtonStyle}" Foreground="White"
Click="Button_MaxClick"/> Click="Button_MaxClick"/>
<!--关闭按钮--> <!--关闭按钮-->
<Button Content="&#xe625;" FontFamily="{StaticResource Icons}" <Button Content="&#xe625;" FontFamily="{StaticResource Icons}"
Style="{StaticResource ControlButtonStyle}" Style="{StaticResource ControlButtonStyle}" Foreground="White"
Click="Button_Click"/> Click="Button_Click"/>
</StackPanel> </StackPanel>
@ -378,7 +374,7 @@
</Popup> </Popup>
<!--更换用户姓名等信息--> <!--更换用户姓名等信息-->
<Popup StaysOpen="False" IsOpen="{Binding ElementName=tbtn_user,Path=IsChecked}" PlacementTarget="{Binding ElementName=tbtn_user}" Placement="Right" HorizontalOffset="-160" VerticalOffset="33" AllowsTransparency="True"> <Popup StaysOpen="False" IsOpen="{Binding ElementName=tbtn_user,Path=IsChecked}" PlacementTarget="{Binding ElementName=tbtn_user}" Placement="Right" HorizontalOffset="-160" VerticalOffset="33" AllowsTransparency="True" >
<Grid Margin="5"> <Grid Margin="5">
<!--背景--> <!--背景-->
<Border Width="160" Height="200" Background="#FFF" CornerRadius="5"> <Border Width="160" Height="200" Background="#FFF" CornerRadius="5">
@ -422,14 +418,14 @@
<!--用户真实姓名--> <!--用户真实姓名-->
<TextBlock Text="{Binding CurrentUser.RealName}" <TextBlock Text="{Binding CurrentUser.RealName}"
Grid.Row="1" HorizontalAlignment="Center" Grid.Row="1" HorizontalAlignment="Center"
FontWeight="Bold"/> FontWeight="Bold" FontSize="14"/>
<!--用户年龄及性别--> <!--用户年龄及性别-->
<StackPanel Grid.Row="2" VerticalAlignment="Center" <StackPanel Grid.Row="2" VerticalAlignment="Center"
HorizontalAlignment="Center" HorizontalAlignment="Center"
Orientation="Horizontal" TextBlock.FontSize="11"> Orientation="Horizontal" TextBlock.FontSize="11">
<TextBlock Text="{Binding CurrentUser.Age}" Margin="5,0"/> <TextBlock Text="{Binding CurrentUser.Age}" Margin="5,0" FontSize="14"/>
<TextBlock Text="{Binding CurrentUser.Gender1}" Margin="5,0"/> <TextBlock Text="{Binding CurrentUser.Gender1}" Margin="5,0" FontSize="14"/>
</StackPanel> </StackPanel>
<Border Background="#EEE" Height="0.5" Grid.Row="3"/> <Border Background="#EEE" Height="0.5" Grid.Row="3"/>
@ -438,14 +434,14 @@
<Button Content="修改密码" Grid.Row="4" <Button Content="修改密码" Grid.Row="4"
Style="{StaticResource NormalButtonStyle}" Style="{StaticResource NormalButtonStyle}"
Background="Transparent" Foreground="#409EFE" Background="Transparent" Foreground="#409EFE"
Margin="5,3" FontSize="12" Margin="5,3" FontSize="13"
Command="{Binding ModifyPasswordCommand}"/> Command="{Binding ModifyPasswordCommand}"/>
<!--切换账号--> <!--切换账号-->
<Button Content="切换账号" Grid.Row="5" <Button Content="切换账号" Grid.Row="5"
Style="{StaticResource NormalButtonStyle}" Style="{StaticResource NormalButtonStyle}"
Background="Transparent" Foreground="#409EFE" Background="Transparent" Foreground="#409EFE"
Margin="5,3" FontSize="12" Margin="5,3" FontSize="13"
Command="{Binding SwitchCommand}"/> Command="{Binding SwitchCommand}"/>
</Grid> </Grid>
</Grid> </Grid>
@ -453,7 +449,7 @@
<TabControl Grid.Row="1" Background="Transparent" <TabControl Grid.Row="1" Background="Transparent"
BorderThickness="0" p:RegionManager.RegionName="MainRegion"> BorderThickness="0" p:RegionManager.RegionName="MainRegion" >
<TabControl.Resources> <TabControl.Resources>
<Style TargetType="TabControl"> <Style TargetType="TabControl">
@ -465,7 +461,7 @@
<RowDefinition Height="auto"/> <RowDefinition Height="auto"/>
<RowDefinition/> <RowDefinition/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Border Background="#FAFCFF" BorderBrush="#EEE" BorderThickness="0,1"/> <Border Background="#FAFCFF" BorderBrush="#EEE" BorderThickness="0,1,0,0"/>
<TabPanel x:Name="HeaderPanel" <TabPanel x:Name="HeaderPanel"
Panel.ZIndex="1" Panel.ZIndex="1"
Margin="0,3" Margin="0,3"
@ -518,7 +514,7 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Text="{TemplateBinding Header}" VerticalAlignment="Center" <TextBlock Text="{TemplateBinding Header}" VerticalAlignment="Center"
Margin="10,5,0,5" Margin="10,5,0,5"
FontSize="12"/> FontSize="14"/>
<Grid Grid.Column="1" Name="close_grid" Visibility="Collapsed" <Grid Grid.Column="1" Name="close_grid" Visibility="Collapsed"
Width="30" Margin="0,0,-3,0"> Width="30" Margin="0,0,-3,0">
<Button Grid.Column="1" Style="{StaticResource TabCloseButtonStyle}" <Button Grid.Column="1" Style="{StaticResource TabCloseButtonStyle}"
@ -534,7 +530,7 @@
<Setter TargetName="close_grid" Property="Visibility" Value="Visible"/> <Setter TargetName="close_grid" Property="Visibility" Value="Visible"/>
</DataTrigger> </DataTrigger>
<Trigger Property="IsMouseOver" Value="True"> <Trigger Property="IsMouseOver" Value="True">
<Setter Property="Visibility" Value="Visible" TargetName="close_btn"/> <Setter Property="Visibility" Value="Visible" TargetName="close_btn" />
</Trigger> </Trigger>
<Trigger Property="IsSelected" Value="True"> <Trigger Property="IsSelected" Value="True">
<Setter Property="Visibility" Value="Visible" TargetName="close_btn"/> <Setter Property="Visibility" Value="Visible" TargetName="close_btn"/>
@ -545,7 +541,7 @@
</Setter> </Setter>
<Style.Triggers> <Style.Triggers>
<Trigger Property="IsMouseOver" Value="True"> <Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#EEE"/> <Setter Property="Background" Value="Gray"/>
</Trigger> </Trigger>
<Trigger Property="IsSelected" Value="True"> <Trigger Property="IsSelected" Value="True">
<Setter Property="Background"> <Setter Property="Background">