Skip to content

Commit

Permalink
Merge pull request #51 from WPFDevelopersOrg/dev
Browse files Browse the repository at this point in the history
dev merged into master
  • Loading branch information
yanjinhuagood authored Jul 3, 2023
2 parents 10e177a + cb6a2aa commit e44312b
Show file tree
Hide file tree
Showing 23 changed files with 681 additions and 293 deletions.
194 changes: 115 additions & 79 deletions src/WPFDevelopers.Net40/Themes/Generic.xaml

Large diffs are not rendered by default.

55 changes: 20 additions & 35 deletions src/WPFDevelopers.Net40/Themes/Theme.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:po="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options" po:Freeze="True" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:controls="clr-namespace:WPFDevelopers.Controls" xmlns:helpers="clr-namespace:WPFDevelopers.Helpers" xmlns:shell="clr-namespace:Microsoft.Windows.Shell" xmlns:wpfdev="clr-namespace:WPFDevelopers.Net40" xmlns:converts="clr-namespace:WPFDevelopers.Converts" xmlns:ec="clr-namespace:Microsoft.Expression.Controls" xmlns:drawingControls="clr-namespace:Microsoft.Expression.Drawing.Controls" xmlns:input="clr-namespace:System.Windows.Input;assembly=PresentationCore">
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:po="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options" po:Freeze="True" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:controls="clr-namespace:WPFDevelopers.Controls" xmlns:helpers="clr-namespace:WPFDevelopers.Helpers" xmlns:converts="clr-namespace:WPFDevelopers.Converts" xmlns:shell="clr-namespace:Microsoft.Windows.Shell" xmlns:wpfdev="clr-namespace:WPFDevelopers.Net40" xmlns:ec="clr-namespace:Microsoft.Expression.Controls" xmlns:drawingControls="clr-namespace:Microsoft.Expression.Drawing.Controls" xmlns:input="clr-namespace:System.Windows.Input;assembly=PresentationCore">
<SolidColorBrush x:Key="WD.ButtonFocusVisualColor" po:Freeze="True" Color="#60000000" />
<Color x:Key="WD.ShadowDepthColor" po:Freeze="True">#AA000000</Color>
<Color x:Key="WD.PrimaryTextColor" po:Freeze="True">#909399</Color>
Expand Down Expand Up @@ -636,7 +636,7 @@
</Setter>
</Style>
<Style BasedOn="{StaticResource WD.DefaultButton}" TargetType="{x:Type Button}" />
<Style TargetType="{x:Type wpfdev:Window}" BasedOn="{x:Null}">
<Style BasedOn="{x:Null}" TargetType="{x:Type wpfdev:Window}">
<Setter Property="Foreground" Value="{DynamicResource WD.WindowForegroundColorBrush}" />
<Setter Property="Background" Value="{DynamicResource WD.BackgroundSolidColorBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource WD.WindowBorderBrushSolidColorBrush}" />
Expand All @@ -650,14 +650,14 @@
<Setter Property="FontFamily" Value="{DynamicResource WD.NormalFontFamily}" />
<Setter Property="shell:WindowChrome.WindowChrome">
<Setter.Value>
<shell:WindowChrome GlassFrameThickness="0,0,0,.1" CaptionHeight="{Binding TitleHeight,RelativeSource={RelativeSource AncestorType=wpfdev:Window}}" />
<shell:WindowChrome CaptionHeight="{Binding TitleHeight, RelativeSource={RelativeSource AncestorType=wpfdev:Window}}" GlassFrameThickness="0,0,0,.1" />
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type wpfdev:Window}">
<Border SnapsToDevicePixels="True" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<Grid Background="{TemplateBinding Background}" x:Name="LayoutRoot">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
<Grid x:Name="LayoutRoot" Background="{TemplateBinding Background}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
Expand All @@ -668,43 +668,42 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" MinWidth="30" />
</Grid.ColumnDefinitions>
<Image Source="{TemplateBinding Icon}" Stretch="Fill" VerticalAlignment="Center" HorizontalAlignment="Left" Width="30" Height="30" Margin="14,0,0,0" RenderOptions.BitmapScalingMode="HighQuality" Visibility="{TemplateBinding Icon,Converter={StaticResource ObjectNullToVisibilityConverter}}" />
<TextBlock Text="{TemplateBinding Title}" x:Name="PART_Title" Margin="6,0" Foreground="{TemplateBinding Foreground}" Grid.Column="1" VerticalAlignment="Center" FontSize="{DynamicResource WD.TitleFontSize}" />
<WrapPanel Grid.Column="2" shell:WindowChrome.IsHitTestVisibleInChrome="True" Margin="0,6">
<Image Width="30" Height="30" Margin="14,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" RenderOptions.BitmapScalingMode="HighQuality" Source="{TemplateBinding Icon}" Stretch="Fill" Visibility="{TemplateBinding Icon,&#xD;&#xA; Converter={StaticResource ObjectNullToVisibilityConverter}}" />
<TextBlock x:Name="PART_Title" Grid.Column="1" Margin="6,0" VerticalAlignment="Center" FontSize="{DynamicResource WD.TitleFontSize}" Foreground="{TemplateBinding Foreground}" Text="{TemplateBinding Title}" />
<WrapPanel Grid.Column="2" Margin="0,6" shell:WindowChrome.IsHitTestVisibleInChrome="True">
<WrapPanel x:Name="PART_MinAndMax">
<Button Name="PART_MinimizeButton" IsTabStop="False" Padding="0" Style="{DynamicResource WD.WindowButtonStyle}" Command="{Binding Source={x:Static shell:SystemCommands.MinimizeWindowCommand}}">
<Button Name="PART_MinimizeButton" Padding="0" Command="{Binding Source={x:Static shell:SystemCommands.MinimizeWindowCommand}}" IsTabStop="False" Style="{DynamicResource WD.WindowButtonStyle}">
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
<Rectangle x:Name="MinimizeGlyph" Width="10" Height="1" Margin="0 7 0 0" VerticalAlignment="Bottom" Fill="{TemplateBinding Foreground}" />
<Rectangle x:Name="MinimizeGlyph" Width="10" Height="1" Margin="0,7,0,0" VerticalAlignment="Bottom" Fill="{TemplateBinding Foreground}" />
</Grid>
</Button>
<Button Name="PART_MaximizeButton" IsTabStop="False" Padding="0" Style="{DynamicResource WD.WindowButtonStyle}" Command="{Binding Source={x:Static shell:SystemCommands.MaximizeWindowCommand}}">
<Button Name="PART_MaximizeButton" Padding="0" Command="{Binding Source={x:Static shell:SystemCommands.MaximizeWindowCommand}}" IsTabStop="False" Style="{DynamicResource WD.WindowButtonStyle}">
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
<Path Width="10" Height="10" HorizontalAlignment="Center" VerticalAlignment="Center" Data="{DynamicResource WD.WindowMaximizeGeometry}" Fill="{TemplateBinding Foreground}" Stretch="Fill" UseLayoutRounding="False" />
</Grid>
</Button>
<Button Name="PART_RestoreButton" IsTabStop="False" Padding="0" Style="{DynamicResource WD.WindowButtonStyle}" Command="{Binding Source={x:Static shell:SystemCommands.RestoreWindowCommand}}" Visibility="Collapsed">
<Button Name="PART_RestoreButton" Padding="0" Command="{Binding Source={x:Static shell:SystemCommands.RestoreWindowCommand}}" IsTabStop="False" Style="{DynamicResource WD.WindowButtonStyle}" Visibility="Collapsed">
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
<Path Width="10" Height="10" HorizontalAlignment="Center" VerticalAlignment="Center" Data="{DynamicResource WD.WindowRestoreGeometry}" Fill="{TemplateBinding Foreground}" Stretch="Fill" UseLayoutRounding="False" />
</Grid>
</Button>
</WrapPanel>
<Button Name="PART_CloseButton" IsTabStop="False" Style="{DynamicResource WD.WindowButtonStyle}" Command="{Binding Source={x:Static shell:SystemCommands.CloseWindowCommand}}">
<Button Name="PART_CloseButton" Command="{Binding Source={x:Static shell:SystemCommands.CloseWindowCommand}}" IsTabStop="False" Style="{DynamicResource WD.WindowButtonStyle}">
<Path Width="10" Height="10" HorizontalAlignment="Center" VerticalAlignment="Center" Data="{DynamicResource WD.WindowCloseGeometry}" Fill="{TemplateBinding Foreground}" Stretch="Fill" />
</Button>
</WrapPanel>
</Grid>
<AdornerDecorator Grid.Row="1" KeyboardNavigation.IsTabStop="False">
<ContentPresenter x:Name="MainContentPresenter" ClipToBounds="True" />
</AdornerDecorator>
<ResizeGrip x:Name="ResizeGrip" HorizontalAlignment="Right" VerticalAlignment="Bottom" Grid.Row="1" IsTabStop="False" Visibility="Collapsed" />
<ResizeGrip x:Name="ResizeGrip" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Bottom" IsTabStop="False" Visibility="Collapsed" />
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="WindowState" Value="Maximized">
<Setter Property="Visibility" Value="Visible" TargetName="PART_RestoreButton" />
<Setter Property="Visibility" Value="Collapsed" TargetName="PART_MaximizeButton" />
<!--<Setter Property="BorderThickness" Value="{Binding Source={x:Static shell:SystemParameters2.Current}, Path=WindowResizeBorderThickness}"/>-->
<Setter Property="Margin" TargetName="LayoutRoot" Value="7" />
<Setter TargetName="PART_RestoreButton" Property="Visibility" Value="Visible" />
<Setter TargetName="PART_MaximizeButton" Property="Visibility" Value="Collapsed" />
<Setter TargetName="LayoutRoot" Property="Margin" Value="7" />
</Trigger>
<Trigger Property="WindowStyle" Value="ToolWindow">
<Setter TargetName="PART_MinAndMax" Property="Visibility" Value="Collapsed" />
Expand All @@ -716,13 +715,6 @@
</MultiTrigger.Conditions>
<Setter TargetName="ResizeGrip" Property="Visibility" Value="Visible" />
</MultiTrigger>
<!--<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="ResizeMode" Value="NoResize" />
<Condition Property="WindowStyle" Value="ToolWindow" />
</MultiTrigger.Conditions>
<Setter TargetName="PART_MinAndMax" Property="Visibility" Value="Collapsed" />
</MultiTrigger>-->
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
Expand Down Expand Up @@ -1501,13 +1493,6 @@
</Style.Triggers>
</Style>
<Style BasedOn="{StaticResource DefaultSlider}" TargetType="{x:Type Slider}" />
<Style x:Key="WD.DefaultTextBlock" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="{StaticResource WD.NormalFontSize}" />
<Setter Property="FontFamily" Value="{StaticResource WD.NormalFontFamily}" />
<Setter Property="FontStyle" Value="{StaticResource WD.NormalFontStyle}" />
<Setter Property="FontStretch" Value="{StaticResource WD.NormalFontStretch}" />
</Style>
<Style BasedOn="{StaticResource WD.DefaultTextBlock}" TargetType="{x:Type TextBlock}" />
<Style x:Key="WD.DefaultHyperlink" TargetType="{x:Type Hyperlink}">
<Setter Property="FontSize" Value="{StaticResource WD.NormalFontSize}" />
<Setter Property="FontFamily" Value="{StaticResource WD.NormalFontFamily}" />
Expand Down Expand Up @@ -3633,7 +3618,7 @@
<Setter Property="UseLayoutRounding" Value="True" />
<Setter Property="TextOptions.TextFormattingMode" Value="Display" />
<Setter Property="TextOptions.TextRenderingMode" Value="ClearType" />
<Setter Property="WindowStyle" Value="None" />
<Setter Property="WindowStyle" Value="ToolWindow" />
<Setter Property="FontFamily" Value="{StaticResource WD.NormalFontFamily}" />
<Setter Property="Template">
<Setter.Value>
Expand All @@ -3648,7 +3633,7 @@
<controls:SmallPanel Grid.Row="0">
<DockPanel Margin="20,0,0,0">
<TextBlock x:Name="PART_Title" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="{StaticResource WD.TitleFontSize}" Foreground="{DynamicResource WD.PrimaryTextSolidColorBrush}" />
<Button Name="PART_CloseButton" Margin="0,6" HorizontalAlignment="Right" IsTabStop="False" Style="{DynamicResource WD.WindowButtonStyle}" ToolTip="Close">
<Button Name="PART_CloseButton" Margin="0,6" HorizontalAlignment="Right" IsTabStop="False" Style="{DynamicResource WD.WindowButtonStyle}">
<Path Width="10" Height="10" HorizontalAlignment="Center" VerticalAlignment="Center" Data="{StaticResource WD.WindowCloseGeometry}" Fill="{DynamicResource WD.PrimaryTextSolidColorBrush}" Stretch="Fill" />
</Button>
</DockPanel>
Expand Down Expand Up @@ -3802,7 +3787,7 @@
</Setter>
</Style>
<Style BasedOn="{StaticResource DefaultGridSplitter}" TargetType="{x:Type GridSplitter}" />
<Style x:Key="WD.DefaultLabel" BasedOn="{StaticResource WD.ControlBasicStyle}" TargetType="{x:Type Label}">
<Style x:Key="WD.DefaultLabel" TargetType="{x:Type Label}">
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Top" />
<Setter Property="Foreground" Value="{DynamicResource WD.PrimaryTextSolidColorBrush}" />
Expand Down
Loading

0 comments on commit e44312b

Please sign in to comment.