Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/Xamarin.PropertyEditing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Maupin <ermaup@microsoft.com>2018-02-02 00:20:04 +0300
committerEric Maupin <ermaup@microsoft.com>2018-02-02 00:24:29 +0300
commitcd77c627344538dacc78f3dbea5029e48dec1190 (patch)
treeaa592297f2766c08e2d77bf0784811c85d3733e7 /Xamarin.PropertyEditing.Tests
parent5b73d3d0bb91b3f5434ea2e31e04edb9402afb33 (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.cs4
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;