Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public partial class ColorPicker
nameof(CustomPaletteColors),
typeof(ObservableCollection<Windows.UI.Color>),
typeof(ColorPicker),
new PropertyMetadata(Windows.UI.Color.FromArgb(0x00, 0x00, 0x00, 0x00)));
new PropertyMetadata(null));

/// <summary>
/// Gets the list of custom palette colors.
Expand Down Expand Up @@ -64,7 +64,7 @@ public int CustomPaletteColumnCount
nameof(CustomPalette),
typeof(IColorPalette),
typeof(ColorPicker),
new PropertyMetadata(DependencyProperty.UnsetValue));
new PropertyMetadata(null));

/// <summary>
/// Gets or sets the custom color palette.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System;
using Microsoft.Toolkit.Uwp.Helpers;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Media;

Expand Down Expand Up @@ -40,7 +41,8 @@ public object Convert(
}
else
{
throw new ArgumentException("Invalid color value provided");
// Invalid color value provided
return DependencyProperty.UnsetValue;
}

// Get the value component delta
Expand All @@ -50,7 +52,8 @@ public object Convert(
}
catch
{
throw new ArgumentException("Invalid parameter provided, unable to convert to integer");
// Invalid parameter provided, unable to convert to integer
return DependencyProperty.UnsetValue;
}

// Specially handle minimum (black) and maximum (white)
Expand Down Expand Up @@ -119,7 +122,7 @@ public object ConvertBack(
object parameter,
string language)
{
throw new NotImplementedException();
return DependencyProperty.UnsetValue;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System;
using Microsoft.Toolkit.Uwp.Helpers;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Media;

Expand Down Expand Up @@ -34,7 +35,8 @@ public object Convert(
}
else
{
throw new ArgumentException("Invalid color value provided");
// Invalid color value provided
return DependencyProperty.UnsetValue;
}

string hexColor = color.ToHex().Replace("#", string.Empty);
Expand All @@ -58,7 +60,8 @@ public object ConvertBack(
}
catch
{
throw new ArgumentException("Invalid hex color value provided");
// Invalid hex color value provided
return DependencyProperty.UnsetValue;
}
}
else
Expand All @@ -69,7 +72,8 @@ public object ConvertBack(
}
catch
{
throw new ArgumentException("Invalid hex color value provided");
// Invalid hex color value provided
return DependencyProperty.UnsetValue;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using System;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Media;

Expand Down Expand Up @@ -40,7 +41,8 @@ public object Convert(
}
else
{
throw new ArgumentException("Invalid color value provided");
// Invalid color value provided
return DependencyProperty.UnsetValue;
}

// Get the default color when transparency is high
Expand Down Expand Up @@ -81,7 +83,7 @@ public object ConvertBack(
object parameter,
string language)
{
throw new NotImplementedException();
return DependencyProperty.UnsetValue;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using System;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Media;

Expand Down Expand Up @@ -33,7 +34,8 @@ public object Convert(
}
else
{
throw new ArgumentException("Invalid color value provided");
// Invalid color value provided
return DependencyProperty.UnsetValue;
}

return ColorHelper.ToDisplayName(color);
Expand All @@ -46,7 +48,7 @@ public object ConvertBack(
object parameter,
string language)
{
throw new NotImplementedException();
return DependencyProperty.UnsetValue;
}
}
}