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:
authorDominique Louis <savagesoftware@gmail.com>2019-01-04 14:32:04 +0300
committerGitHub <noreply@github.com>2019-01-04 14:32:04 +0300
commit40a8abc96d213b8a00f41a04d7bc494444864cf0 (patch)
tree91489ae7f96ba4eda1692d166cecaee5aa7f895d
parent23771851c35b1c0e041cbef09bb6bf8d9021f86d (diff)
parentf81ff08fef07f8897737071c65846a96e484c962 (diff)
Merge pull request #489 from xamarin/dominique-Fix487
[Mac] ArrangeByMode should use ViewModel ArrangeModes.
-rw-r--r--Xamarin.PropertyEditing.Mac/PropertyEditorPanel.cs14
1 files changed, 8 insertions, 6 deletions
diff --git a/Xamarin.PropertyEditing.Mac/PropertyEditorPanel.cs b/Xamarin.PropertyEditing.Mac/PropertyEditorPanel.cs
index 30e9b7f..1d3c965 100644
--- a/Xamarin.PropertyEditing.Mac/PropertyEditorPanel.cs
+++ b/Xamarin.PropertyEditing.Mac/PropertyEditorPanel.cs
@@ -73,6 +73,14 @@ namespace Xamarin.PropertyEditing.Mac
if (this.viewModel != null) {
this.viewModel.ArrangedPropertiesChanged += OnPropertiesChanged;
this.viewModel.PropertyChanged += OnVmPropertyChanged;
+
+ this.propertyArrangeMode.RemoveAll ();
+ foreach (ArrangeModeViewModel item in this.viewModel.ArrangeModes) {
+ var itemAsString = new NSString (item.ArrangeMode.ToString ());
+ this.propertyArrangeMode.Add (itemAsString);
+ if (item.IsChecked)
+ this.propertyArrangeMode.Select (itemAsString);
+ }
}
}
}
@@ -123,12 +131,6 @@ namespace Xamarin.PropertyEditing.Mac
TranslatesAutoresizingMaskIntoConstraints = false,
};
- var enumValues = Enum.GetValues (typeof (PropertyArrangeMode));
-
- foreach (var item in enumValues) {
- this.propertyArrangeMode.Add (new NSString (item.ToString ())); // TODO May need translating
- }
-
if (IsArrangeEnabled) {
AddSubview (this.propertyArrangeMode);
AddSubview (this.propertyArrangeModeLabel);