Skip to content

Commit 8c72c28

Browse files
robloomichael-hawker
authored andcommitted
Handle theme changes in ColorPickerSlider
1 parent b2b1c23 commit 8c72c28

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Microsoft.Toolkit.Uwp.UI.Controls.Input/ColorPicker/ColorPickerSlider.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
using System;
65
using Microsoft.Toolkit.Uwp.Helpers;
76
using Microsoft.Toolkit.Uwp.UI.Controls.ColorPickerConverters;
7+
using System;
88
using Windows.Foundation;
99
using Windows.UI;
1010
using Windows.UI.Xaml;
@@ -38,6 +38,8 @@ public ColorPickerSlider()
3838
: base()
3939
{
4040
this.DefaultStyleKey = typeof(ColorPickerSlider);
41+
42+
this.ActualThemeChanged += this.ColorPickerSlider_ActualThemeChanged;
4143
}
4244

4345
/***************************************************************************************
@@ -297,5 +299,14 @@ private void OnDependencyPropertyChanged(object sender, DependencyPropertyChange
297299

298300
return;
299301
}
302+
303+
/// <summary>
304+
/// Event handler for when the control's theme changes.
305+
/// </summary>
306+
private void ColorPickerSlider_ActualThemeChanged(FrameworkElement sender, object args)
307+
{
308+
this.UpdateColors();
309+
return;
310+
}
300311
}
301312
}

0 commit comments

Comments
 (0)