Files
2026-06-17 15:04:35 +08:00

121 lines
6.1 KiB
XML

<Application x:Class="HME_MoistureLossMeter.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:HME_MoistureLossMeter"
xmlns:converters="clr-namespace:HME_MoistureLossMeter.Converters"
xmlns:vm="clr-namespace:HME_MoistureLossMeter.ViewModels"
xmlns:views="clr-namespace:HME_MoistureLossMeter.Views"
>
<Application.Resources>
<ResourceDictionary>
<!-- 颜色资源 -->
<Color x:Key="PrimaryColor">#2C3E50</Color>
<Color x:Key="AccentColor">#3498DB</Color>
<Color x:Key="SuccessColor">#27AE60</Color>
<Color x:Key="WarningColor">#F39C12</Color>
<Color x:Key="DangerColor">#E74C3C</Color>
<Color x:Key="BackgroundColor">#ECF0F1</Color>
<Color x:Key="PanelBackgroundColor">#FFFFFF</Color>
<!-- 画刷 -->
<SolidColorBrush x:Key="PrimaryBrush" Color="{StaticResource PrimaryColor}"/>
<SolidColorBrush x:Key="AccentBrush" Color="{StaticResource AccentColor}"/>
<SolidColorBrush x:Key="SuccessBrush" Color="{StaticResource SuccessColor}"/>
<SolidColorBrush x:Key="WarningBrush" Color="{StaticResource WarningColor}"/>
<SolidColorBrush x:Key="DangerBrush" Color="{StaticResource DangerColor}"/>
<SolidColorBrush x:Key="BackgroundBrush" Color="{StaticResource BackgroundColor}"/>
<SolidColorBrush x:Key="PanelBackgroundBrush" Color="{StaticResource PanelBackgroundColor}"/>
<!-- 转换器 -->
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
<!-- 样式 -->
<Style TargetType="Button">
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Padding" Value="12,6"/>
<Setter Property="Margin" Value="4"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Background" Value="{StaticResource AccentBrush}"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="4">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"
Margin="{TemplateBinding Padding}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#2980B9"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#1A5276"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="#BDC3C7"/>
<Setter Property="Foreground" Value="#7F8C8D"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="TextBox">
<Setter Property="FontSize" Value="14"/>
<Setter Property="Padding" Value="4,2"/>
<Setter Property="BorderBrush" Value="#BDC3C7"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Background" Value="{StaticResource PanelBackgroundBrush}"/>
</Style>
<Style TargetType="Label">
<Setter Property="FontSize" Value="14"/>
<Setter Property="Foreground" Value="{StaticResource PrimaryBrush}"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
<Style TargetType="TextBlock" x:Key="DisplayValueStyle">
<Setter Property="FontSize" Value="18"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Foreground" Value="{StaticResource AccentBrush}"/>
</Style>
<Style TargetType="TextBlock" x:Key="DisplayLabelStyle">
<Setter Property="FontSize" Value="12"/>
<Setter Property="Foreground" Value="#7F8C8D"/>
<Setter Property="TextWrapping" Value="Wrap"/>
</Style>
<Style TargetType="Border" x:Key="PanelBorderStyle">
<Setter Property="Background" Value="{StaticResource PanelBackgroundBrush}"/>
<Setter Property="BorderBrush" Value="#E0E0E0"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="CornerRadius" Value="4"/>
<Setter Property="Padding" Value="8"/>
</Style>
<DataTemplate DataType="{x:Type vm:TestViewModel}">
<views:TestView />
</DataTemplate>
<DataTemplate DataType="{x:Type vm:ManualControlViewModel}">
<views:ManualControlView />
</DataTemplate>
<DataTemplate DataType="{x:Type vm:RecordViewModel}">
<views:RecordView />
</DataTemplate>
</ResourceDictionary>
</Application.Resources>
</Application>