|
- <prism:PrismApplication
- x:Class="ModbusDemo.App"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:local="clr-namespace:ModbusDemo"
- xmlns:prism="http://prismlibrary.com/"
- xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes">
- <Application.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <!-- 使用捆绑的主题,设置基础主题为浅色,主色为深紫色,次色为酸橙色 -->
- <materialDesign:BundledTheme BaseTheme="Light" PrimaryColor="LightBlue" SecondaryColor="Lime" />
-
- <!-- 引用 Material Design 2 的默认样式 -->
- <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesign2.Defaults.xaml" />
- </ResourceDictionary.MergedDictionaries>
-
- <Style x:Key="LeftMenuStyle" TargetType="ListBoxItem">
- <Setter Property="MinHeight" Value="40">
- </Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ListBoxItem">
- <Grid>
- <Border x:Name="border">
- </Border>
- <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
- </ContentPresenter>
- </Grid>
-
- <!-- 触发器 -->
- <ControlTemplate.Triggers>
- <Trigger Property="IsSelected" Value="True">
- <Setter TargetName="border" Property="Background" Value="{DynamicResource PrimaryHueLightBrush}">
- </Setter>
- <Setter TargetName="border" Property="Opacity" Value="0.2">
- </Setter>
- </Trigger>
-
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="border" Property="Background" Value="{DynamicResource PrimaryHueLightBrush}">
- </Setter>
- <Setter TargetName="border" Property="Opacity" Value="0.2">
- </Setter>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
- </Application.Resources>
- </prism:PrismApplication>
|