diff options
author | Larry Ewing <lewing@xamarin.com> | 2018-04-04 18:49:21 +0300 |
---|---|---|
committer | Larry Ewing <lewing@microsoft.com> | 2018-07-16 22:05:48 +0300 |
commit | 6d3d1efcd53de59264759e2eb535693ec00ca2ae (patch) | |
tree | 3e7236c67e200d5e9a177af81a8fce99cf1332b9 /Xamarin.PropertyEditing | |
parent | 8a2e35636b82e40b19cc3291e422fde2dd7bc894 (diff) |
Initial SolidBrushEditor logic
Diffstat (limited to 'Xamarin.PropertyEditing')
-rw-r--r-- | Xamarin.PropertyEditing/ViewModels/SolidBrushViewModel.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Xamarin.PropertyEditing/ViewModels/SolidBrushViewModel.cs b/Xamarin.PropertyEditing/ViewModels/SolidBrushViewModel.cs index 51fa012..cf0da06 100644 --- a/Xamarin.PropertyEditing/ViewModels/SolidBrushViewModel.cs +++ b/Xamarin.PropertyEditing/ViewModels/SolidBrushViewModel.cs @@ -47,7 +47,7 @@ namespace Xamarin.PropertyEditing.ViewModels OnPropertyChanged (); Parent.Value = new CommonSolidBrush ( new CommonColor(value.R, value.G, value.B, Color.A), - ColorSpace, Parent.Value.Opacity); + ColorSpace, Parent.Value?.Opacity ?? 1); } } } @@ -57,7 +57,7 @@ namespace Xamarin.PropertyEditing.ViewModels get => Parent.Value is CommonSolidBrush solidBrush ? solidBrush.Color : new CommonColor (0, 0, 0); set { if (!Color.Equals (value)) { - Parent.Value = new CommonSolidBrush (value, ColorSpace, Parent.Value.Opacity); + Parent.Value = new CommonSolidBrush (value, ColorSpace, Parent.Value?.Opacity ?? 1); OnPropertyChanged (); if (!this.initialColor.HasValue) { this.initialColor = value; |