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 5
5
using System ;
6
6
using Microsoft . Toolkit . Uwp . Helpers ;
7
7
using Windows . UI ;
8
+ using Windows . UI . Xaml ;
8
9
using Windows . UI . Xaml . Data ;
9
10
using Windows . UI . Xaml . Media ;
10
11
@@ -40,7 +41,8 @@ public object Convert(
40
41
}
41
42
else
42
43
{
43
- throw new ArgumentException ( "Invalid color value provided" ) ;
44
+ // Invalid color value provided
45
+ return DependencyProperty . UnsetValue ;
44
46
}
45
47
46
48
// Get the value component delta
@@ -50,7 +52,8 @@ public object Convert(
50
52
}
51
53
catch
52
54
{
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 ;
54
57
}
55
58
56
59
// Specially handle minimum (black) and maximum (white)
@@ -119,7 +122,7 @@ public object ConvertBack(
119
122
object parameter ,
120
123
string language )
121
124
{
122
- throw new NotImplementedException ( ) ;
125
+ return DependencyProperty . UnsetValue ;
123
126
}
124
127
}
125
128
}
Original file line number Diff line number Diff line change 5
5
using System ;
6
6
using Microsoft . Toolkit . Uwp . Helpers ;
7
7
using Windows . UI ;
8
+ using Windows . UI . Xaml ;
8
9
using Windows . UI . Xaml . Data ;
9
10
using Windows . UI . Xaml . Media ;
10
11
@@ -34,7 +35,8 @@ public object Convert(
34
35
}
35
36
else
36
37
{
37
- throw new ArgumentException ( "Invalid color value provided" ) ;
38
+ // Invalid color value provided
39
+ return DependencyProperty . UnsetValue ;
38
40
}
39
41
40
42
string hexColor = color . ToHex ( ) . Replace ( "#" , string . Empty ) ;
@@ -58,7 +60,8 @@ public object ConvertBack(
58
60
}
59
61
catch
60
62
{
61
- throw new ArgumentException ( "Invalid hex color value provided" ) ;
63
+ // Invalid hex color value provided
64
+ return DependencyProperty . UnsetValue ;
62
65
}
63
66
}
64
67
else
@@ -69,7 +72,8 @@ public object ConvertBack(
69
72
}
70
73
catch
71
74
{
72
- throw new ArgumentException ( "Invalid hex color value provided" ) ;
75
+ // Invalid hex color value provided
76
+ return DependencyProperty . UnsetValue ;
73
77
}
74
78
}
75
79
}
Original file line number Diff line number Diff line change 4
4
5
5
using System ;
6
6
using Windows . UI ;
7
+ using Windows . UI . Xaml ;
7
8
using Windows . UI . Xaml . Data ;
8
9
using Windows . UI . Xaml . Media ;
9
10
@@ -40,7 +41,8 @@ public object Convert(
40
41
}
41
42
else
42
43
{
43
- throw new ArgumentException ( "Invalid color value provided" ) ;
44
+ // Invalid color value provided
45
+ return DependencyProperty . UnsetValue ;
44
46
}
45
47
46
48
// Get the default color when transparency is high
@@ -81,7 +83,7 @@ public object ConvertBack(
81
83
object parameter ,
82
84
string language )
83
85
{
84
- throw new NotImplementedException ( ) ;
86
+ return DependencyProperty . UnsetValue ;
85
87
}
86
88
87
89
/// <summary>
Original file line number Diff line number Diff line change 4
4
5
5
using System ;
6
6
using Windows . UI ;
7
+ using Windows . UI . Xaml ;
7
8
using Windows . UI . Xaml . Data ;
8
9
using Windows . UI . Xaml . Media ;
9
10
@@ -33,7 +34,8 @@ public object Convert(
33
34
}
34
35
else
35
36
{
36
- throw new ArgumentException ( "Invalid color value provided" ) ;
37
+ // Invalid color value provided
38
+ return DependencyProperty . UnsetValue ;
37
39
}
38
40
39
41
return ColorHelper . ToDisplayName ( color ) ;
@@ -46,7 +48,7 @@ public object ConvertBack(
46
48
object parameter ,
47
49
string language )
48
50
{
49
- throw new NotImplementedException ( ) ;
51
+ return DependencyProperty . UnsetValue ;
50
52
}
51
53
}
52
54
}
You can’t perform that action at this time.
0 commit comments