修复窗口大小问题

This commit is contained in:
ShrlAlgo
2025-09-19 09:18:09 +08:00
parent d71019ac38
commit 3fc465959b
34 changed files with 592 additions and 238 deletions

View File

@@ -12,7 +12,10 @@
<!--<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/Internal/MaterialDesignTheme.BaseThemeColors.xaml" />-->
<!--<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Dark.xaml" />-->
<materialDesign:BundledTheme BaseTheme="Dark" PrimaryColor="Teal" SecondaryColor="Green" />
<materialDesign:BundledTheme
BaseTheme="Dark"
PrimaryColor="Teal"
SecondaryColor="Green" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesign3.Defaults.xaml" />
<ResourceDictionary Source="pack://application:,,,/Szmedi.RvKits;component/Controls/MaterialWindow.xaml" />
<!--<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Dark.xaml" />-->
@@ -23,7 +26,7 @@
<ResourceDictionary Source="pack://application:,,,/MaterialDesignExtensions;component/Themes/MaterialDesignDarkTheme.xaml" />-->
</ResourceDictionary.MergedDictionaries>
<!--<SolidColorBrush x:Key="PrimaryHueLightBrush" Color="#744CE0" />-->
<FontFamily x:Key="SourceHanSansSC">pack://application:,,,/Szmedi.RvKits;component/Fonts/#Source Han Sans SC</FontFamily>
<!--<FontFamily x:Key="SourceHanSansSC">pack://application:,,,/Szmedi.RvKits;component/Fonts/#Source Han Sans SC</FontFamily>-->
<!--#region Converters-->
<!--<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />-->
<!--<converters:InvertBooleanToVisibilityConverter x:Key="InvertBooleanToVisibilityConverter" />-->
@@ -74,12 +77,14 @@
<!--<Style BasedOn="{StaticResource MaterialDesignWindow}" TargetType="{x:Type Window}">
<Setter Property="FontFamily" Value="{StaticResource SourceHanSansSC}" />
--><!--<Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Background}" />-->
<!--<Setter Property="TextElement.FontSize" Value="13" />-->
<!--<Setter Property="TextElement.FontWeight" Value="Regular" />-->
<!--<Setter Property="TextOptions.TextRenderingMode" Value="Auto" />-->
<!--<Setter Property="TextOptions.TextFormattingMode" Value="Ideal" />-->
<!--<Setter Property="TextElement.Foreground" Value="{DynamicResource MaterialDesign.Brush.Foreground}" />--><!--
-->
<!--<Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Background}" />-->
<!--<Setter Property="TextElement.FontSize" Value="13" />-->
<!--<Setter Property="TextElement.FontWeight" Value="Regular" />-->
<!--<Setter Property="TextOptions.TextRenderingMode" Value="Auto" />-->
<!--<Setter Property="TextOptions.TextFormattingMode" Value="Ideal" />-->
<!--<Setter Property="TextElement.Foreground" Value="{DynamicResource MaterialDesign.Brush.Foreground}" />-->
<!--
<Setter Property="ShowInTaskbar" Value="False" />
<Setter Property="SizeToContent" Value="WidthAndHeight" />
</Style>-->
@@ -99,18 +104,18 @@
<Style BasedOn="{StaticResource MaterialDesignDataGrid}" TargetType="DataGrid">
<Setter Property="Margin" Value="5" />
</Style>
<Style TargetType="Page">
<!--<Setter Property="TextElement.FontSize" Value="13" />-->
<!--<Setter Property="TextElement.FontWeight" Value="Regular" />-->
<!--<Setter Property="TextOptions.TextRenderingMode" Value="Auto" />-->
<!--<Setter Property="TextOptions.TextFormattingMode" Value="Ideal" />-->
<!--<Setter Property="Background" Value="{StaticResource MaterialDesign.Brush.Background}" />-->
<!--<Setter Property="TextElement.Foreground" Value="{DynamicResource MaterialDesign.Brush.Foreground}" />-->
<!--<Style TargetType="Page">
<Setter Property="TextElement.FontSize" Value="13" />
<Setter Property="TextElement.FontWeight" Value="Regular" />
<Setter Property="TextOptions.TextRenderingMode" Value="Auto" />
<Setter Property="TextOptions.TextFormattingMode" Value="Ideal" />
<Setter Property="Background" Value="{StaticResource MaterialDesign.Brush.Background}" />
<Setter Property="TextElement.Foreground" Value="{DynamicResource MaterialDesign.Brush.Foreground}" />
<Setter Property="FontFamily" Value="{StaticResource SourceHanSansSC}" />
</Style>
</Style>-->
<Style BasedOn="{StaticResource MaterialDesignOutlinedTextBox}" TargetType="TextBox">
<Setter Property="Margin" Value="5" />
<Setter Property="Padding" Value="10"/>
<Setter Property="Padding" Value="10" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="TextAlignment" Value="Center" />
<Setter Property="Validation.ErrorTemplate">
@@ -118,7 +123,10 @@
<ControlTemplate>
<StackPanel>
<AdornedElementPlaceholder Name="Adorner" />
<TextBlock HorizontalAlignment="Right" Foreground="Red" Text="{Binding ElementName=Adorner, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}" />
<TextBlock
HorizontalAlignment="Right"
Foreground="Red"
Text="{Binding ElementName=Adorner, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}" />
</StackPanel>
</ControlTemplate>
</Setter.Value>
@@ -130,7 +138,7 @@
</Style>
<Style BasedOn="{StaticResource MaterialDesignOutlinedComboBox}" TargetType="ComboBox">
<Setter Property="Margin" Value="5" />
<Setter Property="Padding" Value="10"/>
<Setter Property="Padding" Value="10" />
</Style>
<Style BasedOn="{StaticResource MaterialDesignFlatPrimaryToggleButton}" TargetType="ToggleButton">
<Setter Property="Margin" Value="5" />