Skip to content

Commit 21aea6f

Browse files
committed
Disconnect any old events in OnApplyTemplate()
1 parent 8cc36dd commit 21aea6f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ private static bool IsColorEmpty(Color color)
174174
/// </summary>
175175
protected override void OnApplyTemplate()
176176
{
177-
//// TODO: We need to disconnect old events first.
177+
// We need to disconnect old events first
178+
this.ConnectEvents(false);
178179

179180
this.ColorSpectrumControl = this.GetTemplateChild<ColorSpectrum>(nameof(ColorSpectrumControl));
180181
this.ColorSpectrumAlphaSlider = this.GetTemplateChild<Slider>(nameof(ColorSpectrumAlphaSlider));

0 commit comments

Comments
 (0)