diff options
author | Eric Maupin <ermaup@microsoft.com> | 2018-02-02 00:20:04 +0300 |
---|---|---|
committer | Eric Maupin <ermaup@microsoft.com> | 2018-02-02 00:24:29 +0300 |
commit | cd77c627344538dacc78f3dbea5029e48dec1190 (patch) | |
tree | aa592297f2766c08e2d77bf0784811c85d3733e7 /Xamarin.PropertyEditing.Tests | |
parent | 5b73d3d0bb91b3f5434ea2e31e04edb9402afb33 (diff) |
[Tests] Mock editor behave correctly for return to default
Also documented this behavior in IObjectEditor. It's up to to the
platform to determine what constitutes setting a value back to default.
Diffstat (limited to 'Xamarin.PropertyEditing.Tests')
-rw-r--r-- | Xamarin.PropertyEditing.Tests/MockObjectEditor.cs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Xamarin.PropertyEditing.Tests/MockObjectEditor.cs b/Xamarin.PropertyEditing.Tests/MockObjectEditor.cs index 0529484..0b5389a 100644 --- a/Xamarin.PropertyEditing.Tests/MockObjectEditor.cs +++ b/Xamarin.PropertyEditing.Tests/MockObjectEditor.cs @@ -139,6 +139,10 @@ namespace Xamarin.PropertyEditing.Tests if (value.Source != ValueSource.Local && ValueEvaluator != null) { value.Value = (T)ValueEvaluator (property, value.ValueDescriptor); + } else if (value.Source == ValueSource.Unset || (SupportsDefault && Equals (value.Value, default(T)))) { + this.values.Remove (property); + PropertyChanged?.Invoke (this, new EditorPropertyChangedEventArgs (property)); + return; } object softValue = value; |