Files
06-Note/WPF/Wpf.Ui.xaml

139 lines
6.4 KiB
Plaintext
Raw Permalink Normal View History

2023-06-20 09:22:53 +08:00
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--#region Wpf-Ui-->
<!-- xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" -->
<!--<Style
x:Key="StandardFluentWindowStyle"
BasedOn="{StaticResource {x:Type Window}}"
TargetType="{x:Type ui:FluentWindow}">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="{DynamicResource ApplicationBackgroundColor}" />
</Setter.Value>
</Setter>
<Setter Property="Foreground">
<Setter.Value>
<SolidColorBrush Color="{DynamicResource TextFillColorPrimary}" />
</Setter.Value>
</Setter>
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Height" Value="600" />
<Setter Property="MinHeight" Value="320" />
<Setter Property="Width" Value="1100" />
<Setter Property="MinWidth" Value="460" />
<Setter Property="Margin" Value="0" />
<Setter Property="Padding" Value="0" />
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="UseLayoutRounding" Value="True" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Window}">
<Grid Background="{TemplateBinding Background}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ui:TitleBar AllowDrop="True" />
<AdornerDecorator Grid.Row="1">
<ui:ClientAreaBorder
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter x:Name="ContentPresenter" />
</ui:ClientAreaBorder>
</AdornerDecorator>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="WindowState" Value="Normal">
<Setter Property="ResizeMode" Value="CanResize" />
</Trigger>
<Trigger Property="WindowState" Value="Maximized">
<Setter Property="ResizeMode" Value="NoResize" />
</Trigger>
</Style.Triggers>
</Style>
<Style BasedOn="{StaticResource StandardFluentWindowStyle}" TargetType="ui:FluentWindow">
<Setter Property="FontFamily" Value="Microsoft YaHei UI" />
<Setter Property="ShowInTaskbar" Value="True" />
</Style>
<Style BasedOn="{StaticResource {x:Type ContextMenu}}" TargetType="ContextMenu">
<Setter Property="FontFamily" Value="Microsoft YaHei UI" />
</Style>
<Style BasedOn="{StaticResource DefaultTextBoxStyle}" TargetType="TextBox">
<Setter Property="Margin" Value="5" />
</Style>
<Style BasedOn="{StaticResource DefaultUiTextBoxStyle}" TargetType="ui:TextBox">
<Setter Property="Margin" Value="5" />
</Style>
<Style BasedOn="{StaticResource DefaultUiNumberBoxStyle}" TargetType="ui:NumberBox">
<Setter Property="Margin" Value="5" />
<Setter Property="MaxDecimalPlaces" Value="0" />
</Style>
<Style BasedOn="{StaticResource DefaultButtonStyle}" TargetType="Button">
<Setter Property="Margin" Value="5" />
<Setter Property="FontFamily" Value="Microsoft YaHei UI" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
</Style>
<Style BasedOn="{StaticResource {x:Type TextBlock}}" TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Margin" Value="5" />
</Style>
<Style BasedOn="{StaticResource {x:Type Slider}}" TargetType="Slider">
<Setter Property="VerticalAlignment" Value="Bottom" />
<Setter Property="Margin" Value="5" />
<Setter Property="TickFrequency" Value="5" />
<Setter Property="TickPlacement" Value="BottomRight" />
<Setter Property="IsSelectionRangeEnabled" Value="True" />
</Style>
<Style BasedOn="{StaticResource DefaultDataGridStyle}" TargetType="DataGrid">
<Setter Property="Margin" Value="5" />
</Style>
<Style BasedOn="{StaticResource DefaultDataGridCellStyle}" TargetType="DataGridCell">
<Setter Property="Margin" Value="5" />
</Style>
<Style BasedOn="{StaticResource {x:Type GroupBox}}" TargetType="GroupBox">
<Setter Property="Margin" Value="5" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style BasedOn="{StaticResource DefaultComboBoxStyle}" TargetType="ComboBox">
<Setter Property="Margin" Value="5" />
</Style>
<Style BasedOn="{StaticResource DefaultRadioButtonStyle}" TargetType="RadioButton">
<Setter Property="Margin" Value="5" />
</Style>
<Style BasedOn="{StaticResource DefaultCheckBoxStyle}" TargetType="CheckBox">
<Setter Property="Margin" Value="5" />
</Style>
<Style BasedOn="{StaticResource {x:Type Label}}" TargetType="Label">
<Setter Property="Margin" Value="5" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style BasedOn="{StaticResource {x:Type TabControl}}" TargetType="TabControl">
<Setter Property="Margin" Value="5" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style BasedOn="{StaticResource DefaultListBoxStyle}" TargetType="ListBox">
<Setter Property="Margin" Value="5" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Cursor" Value="Hand" />
</Style>
<Style BasedOn="{StaticResource DefaultListViewStyle}" TargetType="ListView">
<Setter Property="Margin" Value="5" />
</Style>-->
<!--#endregion-->
</ResourceDictionary>