Skip to content

Commit e86bfee

Browse files
committed
Revert "Derive from the WinUI ColorPicker"
This reverts commit 34bbbc8.
1 parent 0b13dc6 commit e86bfee

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
5252
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1501:Statement should not be on a single line", Justification = "Inline brackets are used to improve code readability with repeated null checks.")]
5353
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1025:Code should not contain multiple whitespace in a row", Justification = "Whitespace is used to align code in columns for readability.")]
5454
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1306:Field names should begin with lower-case letter", Justification = "Only template parts start with a capital letter. This differentiates them from other fields.")]
55-
public partial class ColorPicker : Microsoft.UI.Xaml.Controls.ColorPicker
55+
public partial class ColorPicker : Windows.UI.Xaml.Controls.ColorPicker
5656
{
5757
internal Color CheckerBackgroundColor { get; set; } = Color.FromArgb(0x19, 0x80, 0x80, 0x80); // Overridden later
5858

@@ -122,7 +122,6 @@ public partial class ColorPicker : Microsoft.UI.Xaml.Controls.ColorPicker
122122
public ColorPicker()
123123
{
124124
this.DefaultStyleKey = typeof(ColorPicker);
125-
this.DefaultStyleResourceUri = new System.Uri("ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Input/Themes/Generic.xaml");
126125

127126
// Setup collections
128127
this.SetValue(CustomPaletteColorsProperty, new ObservableCollection<Color>());
@@ -487,22 +486,22 @@ private ColorChannel GetActiveColorSpectrumThirdDimension()
487486
{
488487
switch (this.ColorSpectrumComponents)
489488
{
490-
case Microsoft.UI.Xaml.Controls.ColorSpectrumComponents.SaturationValue:
491-
case Microsoft.UI.Xaml.Controls.ColorSpectrumComponents.ValueSaturation:
489+
case Windows.UI.Xaml.Controls.ColorSpectrumComponents.SaturationValue:
490+
case Windows.UI.Xaml.Controls.ColorSpectrumComponents.ValueSaturation:
492491
{
493492
// Hue
494493
return ColorChannel.Channel1;
495494
}
496495

497-
case Microsoft.UI.Xaml.Controls.ColorSpectrumComponents.HueValue:
498-
case Microsoft.UI.Xaml.Controls.ColorSpectrumComponents.ValueHue:
496+
case Windows.UI.Xaml.Controls.ColorSpectrumComponents.HueValue:
497+
case Windows.UI.Xaml.Controls.ColorSpectrumComponents.ValueHue:
499498
{
500499
// Saturation
501500
return ColorChannel.Channel2;
502501
}
503502

504-
case Microsoft.UI.Xaml.Controls.ColorSpectrumComponents.HueSaturation:
505-
case Microsoft.UI.Xaml.Controls.ColorSpectrumComponents.SaturationHue:
503+
case Windows.UI.Xaml.Controls.ColorSpectrumComponents.HueSaturation:
504+
case Windows.UI.Xaml.Controls.ColorSpectrumComponents.SaturationHue:
506505
{
507506
// Value
508507
return ColorChannel.Channel3;
@@ -1126,7 +1125,7 @@ private void DispatcherQueueTimer_Tick(object sender, object e)
11261125
***************************************************************************************/
11271126

11281127
/// <summary>
1129-
/// Callback for when the <see cref="Microsoft.UI.Xaml.Controls.ColorPicker.Color"/> dependency property value changes.
1128+
/// Callback for when the <see cref="Windows.UI.Xaml.Controls.ColorPicker.Color"/> dependency property value changes.
11301129
/// </summary>
11311130
private void OnColorChanged(DependencyObject d, DependencyProperty e)
11321131
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ protected override void OnApplyTemplate()
142142
}
143143
}
144144

145-
private void ColorPicker_ColorChanged(Microsoft.UI.Xaml.Controls.ColorPicker sender, Microsoft.UI.Xaml.Controls.ColorChangedEventArgs args)
145+
private void ColorPicker_ColorChanged(Windows.UI.Xaml.Controls.ColorPicker sender, ColorChangedEventArgs args)
146146
{
147147
SelectedColor = args.NewColor;
148148
}

0 commit comments

Comments
 (0)