File tree Expand file tree Collapse file tree 4 files changed +21
-10
lines changed
Microsoft.Toolkit.Uwp.UI.Controls.Input/ColorPicker
Microsoft.Toolkit.Uwp.UI/Converters Expand file tree Collapse file tree 4 files changed +21
-10
lines changed Original file line number Diff line number Diff line change 55using System ;
66using Microsoft . Toolkit . Uwp . Helpers ;
77using Windows . UI ;
8+ using Windows . UI . Xaml ;
89using Windows . UI . Xaml . Data ;
910using Windows . UI . Xaml . Media ;
1011
@@ -40,7 +41,8 @@ public object Convert(
4041 }
4142 else
4243 {
43- throw new ArgumentException ( "Invalid color value provided" ) ;
44+ // Invalid color value provided
45+ return DependencyProperty . UnsetValue ;
4446 }
4547
4648 // Get the value component delta
@@ -50,7 +52,8 @@ public object Convert(
5052 }
5153 catch
5254 {
53- throw new ArgumentException ( "Invalid parameter provided, unable to convert to integer" ) ;
55+ // Invalid parameter provided, unable to convert to integer
56+ return DependencyProperty . UnsetValue ;
5457 }
5558
5659 // Specially handle minimum (black) and maximum (white)
@@ -119,7 +122,7 @@ public object ConvertBack(
119122 object parameter ,
120123 string language )
121124 {
122- throw new NotImplementedException ( ) ;
125+ return DependencyProperty . UnsetValue ;
123126 }
124127 }
125128}
Original file line number Diff line number Diff line change 55using System ;
66using Microsoft . Toolkit . Uwp . Helpers ;
77using Windows . UI ;
8+ using Windows . UI . Xaml ;
89using Windows . UI . Xaml . Data ;
910using Windows . UI . Xaml . Media ;
1011
@@ -34,7 +35,8 @@ public object Convert(
3435 }
3536 else
3637 {
37- throw new ArgumentException ( "Invalid color value provided" ) ;
38+ // Invalid color value provided
39+ return DependencyProperty . UnsetValue ;
3840 }
3941
4042 string hexColor = color . ToHex ( ) . Replace ( "#" , string . Empty ) ;
@@ -58,7 +60,8 @@ public object ConvertBack(
5860 }
5961 catch
6062 {
61- throw new ArgumentException ( "Invalid hex color value provided" ) ;
63+ // Invalid hex color value provided
64+ return DependencyProperty . UnsetValue ;
6265 }
6366 }
6467 else
@@ -69,7 +72,8 @@ public object ConvertBack(
6972 }
7073 catch
7174 {
72- throw new ArgumentException ( "Invalid hex color value provided" ) ;
75+ // Invalid hex color value provided
76+ return DependencyProperty . UnsetValue ;
7377 }
7478 }
7579 }
Original file line number Diff line number Diff line change 44
55using System ;
66using Windows . UI ;
7+ using Windows . UI . Xaml ;
78using Windows . UI . Xaml . Data ;
89using Windows . UI . Xaml . Media ;
910
@@ -40,7 +41,8 @@ public object Convert(
4041 }
4142 else
4243 {
43- throw new ArgumentException ( "Invalid color value provided" ) ;
44+ // Invalid color value provided
45+ return DependencyProperty . UnsetValue ;
4446 }
4547
4648 // Get the default color when transparency is high
@@ -81,7 +83,7 @@ public object ConvertBack(
8183 object parameter ,
8284 string language )
8385 {
84- throw new NotImplementedException ( ) ;
86+ return DependencyProperty . UnsetValue ;
8587 }
8688
8789 /// <summary>
Original file line number Diff line number Diff line change 44
55using System ;
66using Windows . UI ;
7+ using Windows . UI . Xaml ;
78using Windows . UI . Xaml . Data ;
89using Windows . UI . Xaml . Media ;
910
@@ -33,7 +34,8 @@ public object Convert(
3334 }
3435 else
3536 {
36- throw new ArgumentException ( "Invalid color value provided" ) ;
37+ // Invalid color value provided
38+ return DependencyProperty . UnsetValue ;
3739 }
3840
3941 return ColorHelper . ToDisplayName ( color ) ;
@@ -46,7 +48,7 @@ public object ConvertBack(
4648 object parameter ,
4749 string language )
4850 {
49- throw new NotImplementedException ( ) ;
51+ return DependencyProperty . UnsetValue ;
5052 }
5153 }
5254}
You can’t perform that action at this time.
0 commit comments