From dff3e6956bab0272fe61df66802b0e3420fb3099 Mon Sep 17 00:00:00 2001 From: Dipesh Kumar Date: Mon, 16 Sep 2024 21:37:29 +0530 Subject: [PATCH 1/3] Fixing TemplateBindings in Fluent styles --- .../Resources/Theme/Dark.xaml | 21 +- .../Resources/Theme/HC.xaml | 19 ++ .../Resources/Theme/Light.xaml | 21 +- .../Styles/Button.xaml | 2 +- .../Styles/Calendar.xaml | 18 +- .../Styles/ComboBox.xaml | 2 + .../Styles/ContextMenu.xaml | 5 +- .../Styles/Expander.xaml | 8 +- .../Styles/ListBox.xaml | 10 +- .../Styles/ListBoxItem.xaml | 17 +- .../Styles/ListView.xaml | 54 ++-- .../Styles/ListViewItem.xaml | 25 +- .../Styles/Menu.xaml | 3 +- .../Styles/MenuItem.xaml | 33 ++- .../Styles/Page.xaml | 18 +- .../Styles/RadioButton.xaml | 166 ++++++----- .../Styles/ScrollBar.xaml | 29 +- .../Styles/TabControl.xaml | 32 ++- .../Styles/ToolTip.xaml | 24 +- .../Themes/Fluent.Dark.xaml | 260 +++++++++++------- .../Themes/Fluent.HC.xaml | 258 ++++++++++------- .../Themes/Fluent.Light.xaml | 260 +++++++++++------- 22 files changed, 817 insertions(+), 468 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Dark.xaml b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Dark.xaml index 2c0b16fabf6..cad8e0a64e1 100644 --- a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Dark.xaml +++ b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Dark.xaml @@ -480,7 +480,7 @@ - + @@ -492,6 +492,8 @@ + + @@ -532,6 +534,10 @@ + + + + @@ -546,7 +552,13 @@ + + + + + + @@ -558,8 +570,10 @@ + + @@ -575,6 +589,11 @@ + + + + + diff --git a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/HC.xaml b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/HC.xaml index a5974b8390a..fa1f7bc7016 100644 --- a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/HC.xaml +++ b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/HC.xaml @@ -360,6 +360,8 @@ + + @@ -400,6 +402,10 @@ + + + + @@ -415,7 +421,13 @@ + + + + + + @@ -427,8 +439,10 @@ + + @@ -444,6 +458,11 @@ + + + + + diff --git a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Light.xaml b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Light.xaml index 50f0fbafe84..f48940a91b3 100644 --- a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Light.xaml +++ b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Light.xaml @@ -474,7 +474,7 @@ - + #FFF2F2F2 @@ -487,6 +487,8 @@ + + @@ -527,6 +529,10 @@ + + + + @@ -541,7 +547,13 @@ + + + + + + @@ -553,8 +565,10 @@ + + @@ -570,6 +584,11 @@ + + + + + diff --git a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/Button.xaml b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/Button.xaml index 982e95ed7d2..0aaffac1477 100644 --- a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/Button.xaml +++ b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/Button.xaml @@ -33,7 +33,7 @@ - + - - + + - + @@ -498,9 +498,9 @@ x:Name="PART_Root" Margin="0" Padding="0" - Background="{DynamicResource CalendarViewBackground}" - BorderBrush="{DynamicResource CalendarViewBorderBrush}" - BorderThickness="1" + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}" CornerRadius="4"> @@ -510,9 +510,9 @@ Padding="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" + Background="Transparent" + BorderBrush="Transparent" + BorderThickness="0" Style="{TemplateBinding CalendarItemStyle}" /> diff --git a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/ComboBox.xaml b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/ComboBox.xaml index 188efe84efb..d21927d52ba 100644 --- a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/ComboBox.xaml +++ b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/ComboBox.xaml @@ -205,6 +205,8 @@ Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" + ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}" + SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" IsHitTestVisible="False" TextElement.Foreground="{TemplateBinding Foreground}" /> diff --git a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/ContextMenu.xaml b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/ContextMenu.xaml index d0c1ab21661..8e58a292bfd 100644 --- a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/ContextMenu.xaml +++ b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/ContextMenu.xaml @@ -9,11 +9,14 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> + 1 + @@ -225,10 +234,11 @@ CornerRadius="8,8,0,0"> diff --git a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/ToolTip.xaml b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/ToolTip.xaml index bf9bd19e509..d795b2b18d9 100644 --- a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/ToolTip.xaml +++ b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/ToolTip.xaml @@ -5,10 +5,16 @@ All Rights Reserved. --> - + + + 9,6,9,8 + 320 + 1 - + @@ -2781,8 +2814,8 @@ - - + + @@ -2836,14 +2869,14 @@ - + - - + + @@ -2868,7 +2901,7 @@ - + @@ -2879,8 +2912,8 @@ - - + + @@ -2916,15 +2949,15 @@ - + - - + + @@ -2986,8 +3019,13 @@ @@ -3960,7 +4015,7 @@ - + @@ -4478,8 +4533,11 @@ + 9,6,9,8 + 320 + 1 - + @@ -2753,8 +2786,8 @@ - - + + @@ -2808,14 +2841,14 @@ - + - - + + @@ -2840,7 +2873,7 @@ - + @@ -2851,8 +2884,8 @@ - - + + @@ -2888,15 +2921,15 @@ - + - - + + @@ -2958,8 +2991,13 @@ @@ -3932,7 +3987,7 @@ - + @@ -4450,8 +4505,11 @@ + 9,6,9,8 + 320 + 1 - + @@ -2776,8 +2809,8 @@ - - + + @@ -2831,14 +2864,14 @@ - + - - + + @@ -2863,7 +2896,7 @@ - + @@ -2874,8 +2907,8 @@ - - + + @@ -2911,15 +2944,15 @@ - + - - + + @@ -2981,8 +3014,13 @@ @@ -3955,7 +4010,7 @@ - + @@ -4473,8 +4528,11 @@ + 9,6,9,8 + 320 + 1 9,6,9,8 320 - 1 + 1 9,6,9,8 320 - 1 + 1 9,6,9,8 320 - 1 + 1 + + + + +