From 1e178701e9262a19a3726c77dd66cfb46970936c Mon Sep 17 00:00:00 2001 From: robloo Date: Sat, 20 Aug 2022 20:19:46 -0400 Subject: [PATCH 1/2] Handle theme changes in ColorPickerSlider --- .../ColorPicker/ColorPickerSlider.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Microsoft.Toolkit.Uwp.UI.Controls.Input/ColorPicker/ColorPickerSlider.cs b/Microsoft.Toolkit.Uwp.UI.Controls.Input/ColorPicker/ColorPickerSlider.cs index c2478538415..0a0ecc89320 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls.Input/ColorPicker/ColorPickerSlider.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls.Input/ColorPicker/ColorPickerSlider.cs @@ -2,9 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using Microsoft.Toolkit.Uwp.Helpers; using Microsoft.Toolkit.Uwp.UI.Controls.ColorPickerConverters; +using System; using Windows.Foundation; using Windows.UI; using Windows.UI.Xaml; @@ -38,6 +38,8 @@ public ColorPickerSlider() : base() { this.DefaultStyleKey = typeof(ColorPickerSlider); + + this.ActualThemeChanged += this.ColorPickerSlider_ActualThemeChanged; } /*************************************************************************************** @@ -297,5 +299,14 @@ private void OnDependencyPropertyChanged(object sender, DependencyPropertyChange return; } + + /// + /// Event handler for when the control's theme changes. + /// + private void ColorPickerSlider_ActualThemeChanged(FrameworkElement sender, object args) + { + this.UpdateColors(); + return; + } } } \ No newline at end of file From 2cb5e837fc1b25447a4a1f9bb59bbc4a4d618271 Mon Sep 17 00:00:00 2001 From: michael-hawker <24302614+michael-hawker@users.noreply.github.com> Date: Thu, 20 Oct 2022 22:26:47 -0700 Subject: [PATCH 2/2] Fix using statement order for StyleCop --- .../ColorPicker/ColorPickerSlider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Toolkit.Uwp.UI.Controls.Input/ColorPicker/ColorPickerSlider.cs b/Microsoft.Toolkit.Uwp.UI.Controls.Input/ColorPicker/ColorPickerSlider.cs index 0a0ecc89320..708bbeffe08 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls.Input/ColorPicker/ColorPickerSlider.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls.Input/ColorPicker/ColorPickerSlider.cs @@ -2,9 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System; using Microsoft.Toolkit.Uwp.Helpers; using Microsoft.Toolkit.Uwp.UI.Controls.ColorPickerConverters; -using System; using Windows.Foundation; using Windows.UI; using Windows.UI.Xaml;