From adbff4cdc7cf9b6e2d46e7cadfda23c7eb0b2c7f Mon Sep 17 00:00:00 2001 From: Bastian Schmidt Date: Sat, 11 May 2024 08:05:07 +0200 Subject: [PATCH 01/10] Updating ControlzEx --- src/Directory.packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Directory.packages.props b/src/Directory.packages.props index 091885fb0..e7ec8cacc 100644 --- a/src/Directory.packages.props +++ b/src/Directory.packages.props @@ -4,7 +4,7 @@ true - + From 4e4fc8cd2d7439bca04ab0bc9a4cf807215ba86c Mon Sep 17 00:00:00 2001 From: Bastian Schmidt Date: Sat, 11 May 2024 08:05:31 +0200 Subject: [PATCH 02/10] Adding BackDrop --- .../MahApps.Metro.Demo/MainWindow.xaml | 20 +++++++++++++++++++ .../Styles/Themes/GeneratorParameters.json | 8 ++++++-- .../Styles/Themes/Theme.Template.xaml | 2 ++ src/MahApps.Metro/Themes/MetroWindow.xaml | 20 +++++++++++++++++++ 4 files changed, 48 insertions(+), 2 deletions(-) diff --git a/src/MahApps.Metro.Samples/MahApps.Metro.Demo/MainWindow.xaml b/src/MahApps.Metro.Samples/MahApps.Metro.Demo/MainWindow.xaml index 0fccc39e6..0e19b9cc7 100644 --- a/src/MahApps.Metro.Samples/MahApps.Metro.Demo/MainWindow.xaml +++ b/src/MahApps.Metro.Samples/MahApps.Metro.Demo/MainWindow.xaml @@ -114,6 +114,14 @@ + + + + + + @@ -238,6 +246,18 @@ + + + + + + + + + + diff --git a/src/MahApps.Metro/Themes/MetroWindow.xaml b/src/MahApps.Metro/Themes/MetroWindow.xaml index f571ed732..0a9438429 100644 --- a/src/MahApps.Metro/Themes/MetroWindow.xaml +++ b/src/MahApps.Metro/Themes/MetroWindow.xaml @@ -574,6 +574,7 @@ + @@ -592,6 +593,25 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 73ed66b98ae1a6bd72d6cf20d36052c0de53c625 Mon Sep 17 00:00:00 2001 From: Bastian Schmidt Date: Sat, 11 May 2024 08:05:53 +0200 Subject: [PATCH 03/10] Improving native ContextMenu in demo --- .../MahApps.Metro.Demo/App.xaml.cs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/MahApps.Metro.Samples/MahApps.Metro.Demo/App.xaml.cs b/src/MahApps.Metro.Samples/MahApps.Metro.Demo/App.xaml.cs index 211f14b3d..6409d4285 100644 --- a/src/MahApps.Metro.Samples/MahApps.Metro.Demo/App.xaml.cs +++ b/src/MahApps.Metro.Samples/MahApps.Metro.Demo/App.xaml.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Windows; +using ControlzEx.Theming; namespace MetroDemo { @@ -11,5 +12,28 @@ namespace MetroDemo /// public partial class App : Application { + /// + protected override void OnStartup(StartupEventArgs e) + { + ThemeManager.Current.ThemeSyncMode = ThemeSyncMode.SyncWithAppMode; + ThemeManager.Current.SyncTheme(); + + ThemeManager.Current.ThemeChanged += HandleThemeChanged; + +#pragma warning disable CS0618 // Type or member is obsolete + AppModeHelper.SyncAppMode(); +#pragma warning restore CS0618 // Type or member is obsolete + + base.OnStartup(e); + + return; + + void HandleThemeChanged(object? sender, ThemeChangedEventArgs themeChangedEventArgs) + { +#pragma warning disable CS0618 // Type or member is obsolete + AppModeHelper.SyncAppMode(); +#pragma warning restore CS0618 // Type or member is obsolete + } + } } } \ No newline at end of file From d1b98b5e8cf0482439f1f2fd82cc597c4834433d Mon Sep 17 00:00:00 2001 From: punker76 Date: Sat, 11 May 2024 12:24:20 +0200 Subject: [PATCH 04/10] ci: try to find out what's going wrong on appveyor --- appveyor.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 9f20981bc..adccf8034 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,6 +6,8 @@ branches: - main environment: + # bad, but without this, gitversion doesn't work anymore + IGNORE_NORMALISATION_GIT_HEAD_MOVE: 1 azure-key-vault-url: secure: 1mKS/HfCVq+iYNRVSrrN8NEowOkKt3knrpMzw+SOy3g= azure-key-vault-client-id: @@ -29,8 +31,8 @@ install: { git checkout -qf $($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT) } - - ps: Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile 'dotnet-install.ps1' - - ps: ./dotnet-install.ps1 -Version 8.0.100 -InstallDir "C:\Program Files\dotnet" +# - ps: Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile 'dotnet-install.ps1' +# - ps: ./dotnet-install.ps1 -Version 8.0.100 -InstallDir "C:\Program Files\dotnet" pull_requests: do_not_increment_build_number: false @@ -38,7 +40,7 @@ pull_requests: build_script: - ps: dotnet --info - ps: gitversion /version - - ps: .\build.ps1 --target=ci #--verbosity=diagnostic + - ps: .\build.ps1 --target=ci --verbosity=diagnostic after_build: - ps: gci -Filter *.trx -Path .\TestResults\ | % { (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/mstest/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $_.FullName)) } From c371d6ff107ea7ec7b8335ab6876df321f10f3f1 Mon Sep 17 00:00:00 2001 From: punker76 Date: Sun, 28 Jul 2024 23:24:54 +0200 Subject: [PATCH 05/10] fix: wrong demo code --- .../MahApps.Metro.Demo/App.xaml.cs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/MahApps.Metro.Samples/MahApps.Metro.Demo/App.xaml.cs b/src/MahApps.Metro.Samples/MahApps.Metro.Demo/App.xaml.cs index 6409d4285..01d8d50c4 100644 --- a/src/MahApps.Metro.Samples/MahApps.Metro.Demo/App.xaml.cs +++ b/src/MahApps.Metro.Samples/MahApps.Metro.Demo/App.xaml.cs @@ -15,25 +15,22 @@ public partial class App : Application /// protected override void OnStartup(StartupEventArgs e) { - ThemeManager.Current.ThemeSyncMode = ThemeSyncMode.SyncWithAppMode; + base.OnStartup(e); + + ThemeManager.Current.ThemeSyncMode = ThemeSyncMode.SyncAll; + ThemeManager.Current.SyncTheme(); - ThemeManager.Current.ThemeChanged += HandleThemeChanged; + ThemeManager.Current.ThemeChanged += CurrentOnThemeChanged; #pragma warning disable CS0618 // Type or member is obsolete AppModeHelper.SyncAppMode(); -#pragma warning restore CS0618 // Type or member is obsolete - - base.OnStartup(e); - - return; - void HandleThemeChanged(object? sender, ThemeChangedEventArgs themeChangedEventArgs) + void CurrentOnThemeChanged(object? sender, ThemeChangedEventArgs themeChangedEventArgs) { -#pragma warning disable CS0618 // Type or member is obsolete AppModeHelper.SyncAppMode(); -#pragma warning restore CS0618 // Type or member is obsolete } +#pragma warning restore CS0618 // Type or member is obsolete } } } \ No newline at end of file From ee1a7cd278231f7395f7565fb15a5af54d2818ff Mon Sep 17 00:00:00 2001 From: punker76 Date: Sun, 13 Oct 2024 00:26:24 +0200 Subject: [PATCH 06/10] chore: update package refs --- src/Directory.Build.Props | 10 ++++-- src/Directory.packages.props | 32 ++++++++++--------- .../ExampleViews/ButtonsExample.xaml | 4 +-- .../ExampleViews/DateExamples.xaml | 2 +- .../ExampleViews/SplitViewExamples.xaml | 6 +++- .../ExampleViews/TextExamples.xaml | 4 +-- src/MahApps.Metro.sln.DotSettings | 5 +++ src/MahApps.Metro/MahApps.Metro.csproj | 8 ++++- src/MahApps.Metro/Themes/DateTimePicker.xaml | 8 ++--- .../Tests/MultiSelectorHelperTests.cs | 17 +++++----- 10 files changed, 60 insertions(+), 36 deletions(-) diff --git a/src/Directory.Build.Props b/src/Directory.Build.Props index c8701cf07..d77e280e7 100644 --- a/src/Directory.Build.Props +++ b/src/Directory.Build.Props @@ -67,8 +67,14 @@ - - + + all + compile; build + + + all + build;analyzers + diff --git a/src/Directory.packages.props b/src/Directory.packages.props index e7ec8cacc..363615d7f 100644 --- a/src/Directory.packages.props +++ b/src/Directory.packages.props @@ -4,32 +4,34 @@ true - + - + - - - - - + + + + + - - + + - + + + - - - - - + + + + + \ No newline at end of file diff --git a/src/MahApps.Metro.Samples/MahApps.Metro.Demo/ExampleViews/ButtonsExample.xaml b/src/MahApps.Metro.Samples/MahApps.Metro.Demo/ExampleViews/ButtonsExample.xaml index fe92eddd8..64515a99d 100644 --- a/src/MahApps.Metro.Samples/MahApps.Metro.Demo/ExampleViews/ButtonsExample.xaml +++ b/src/MahApps.Metro.Samples/MahApps.Metro.Demo/ExampleViews/ButtonsExample.xaml @@ -329,8 +329,8 @@ + IsOn="{Binding CanUseToggleSwitch, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" + Toggled="ToggleSwitch_OnToggled" /> - + diff --git a/src/MahApps.Metro.Samples/MahApps.Metro.Demo/ExampleViews/TextExamples.xaml b/src/MahApps.Metro.Samples/MahApps.Metro.Demo/ExampleViews/TextExamples.xaml index c555c141e..2be2b1512 100644 --- a/src/MahApps.Metro.Samples/MahApps.Metro.Demo/ExampleViews/TextExamples.xaml +++ b/src/MahApps.Metro.Samples/MahApps.Metro.Demo/ExampleViews/TextExamples.xaml @@ -376,9 +376,9 @@ - diff --git a/src/MahApps.Metro.sln.DotSettings b/src/MahApps.Metro.sln.DotSettings index 81ec5f4b9..81a278fa9 100644 --- a/src/MahApps.Metro.sln.DotSettings +++ b/src/MahApps.Metro.sln.DotSettings @@ -709,7 +709,10 @@ See the LICENSE file in the project root for more information. <Policy Inspect="True" Prefix="PART_" Suffix="" Style="AaBb"><ExtraRule Prefix="" Suffix="" Style="AaBb" /></Policy> <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy><Descriptor Staticness="Any" AccessRightKinds="Private" Description="Constant fields (private)"><ElementKinds><Kind Name="CONSTANT_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="PART_" Suffix="" Style="AaBb"><ExtraRule Prefix="" Suffix="" Style="AaBb" /></Policy></Policy> + <Policy><Descriptor Staticness="Instance" AccessRightKinds="Private" Description="Instance fields (private)"><ElementKinds><Kind Name="FIELD" /><Kind Name="READONLY_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></Policy> <Policy><Descriptor Staticness="Instance" AccessRightKinds="Public" Description="Test methods"><ElementKinds><Kind Name="TEST_TYPE" /><Kind Name="TEST_MEMBER" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb_AaBb" /></Policy> + <Policy><Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static fields (private)"><ElementKinds><Kind Name="FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></Policy> <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> @@ -796,11 +799,13 @@ See the LICENSE file in the project root for more information. True True True + True True True True True True + True True True True diff --git a/src/MahApps.Metro/MahApps.Metro.csproj b/src/MahApps.Metro/MahApps.Metro.csproj index a7b9cd1ed..674b762b5 100644 --- a/src/MahApps.Metro/MahApps.Metro.csproj +++ b/src/MahApps.Metro/MahApps.Metro.csproj @@ -1,4 +1,4 @@ - + @@ -33,6 +33,12 @@ all runtime; build; native; contentfiles; analyzers + + + + + + diff --git a/src/MahApps.Metro/Themes/DateTimePicker.xaml b/src/MahApps.Metro/Themes/DateTimePicker.xaml index 4c6a1d26c..56a9d8b9d 100644 --- a/src/MahApps.Metro/Themes/DateTimePicker.xaml +++ b/src/MahApps.Metro/Themes/DateTimePicker.xaml @@ -356,8 +356,8 @@ ItemsSource="{TemplateBinding SourceHours}" />