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>2019-07-03 19:22:33 +0300
committerGitHub <noreply@github.com>2019-07-03 19:22:33 +0300
commit98584081ea54226fe486977032f8e2dd93f62fca (patch)
tree97e61608b404ef97bc44aa1ecd9cc1ecf20f9313 /Xamarin.PropertyEditing.Mac/Controls/Custom/PropertyButton.cs
parent50cbb497b21e77c752a808ff406db9ba47cff84f (diff)
parent1e9797a0e06c817373e40cb0edcb2f297c2baab7 (diff)
Merge pull request #608 from xamarin/dominique-Fix606
[Mac] If VM changes, reset popupMenu list.
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/Controls/Custom/PropertyButton.cs')
-rw-r--r--Xamarin.PropertyEditing.Mac/Controls/Custom/PropertyButton.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/PropertyButton.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/PropertyButton.cs
index 3e3347a..5768136 100644
--- a/Xamarin.PropertyEditing.Mac/Controls/Custom/PropertyButton.cs
+++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/PropertyButton.cs
@@ -15,17 +15,23 @@ namespace Xamarin.PropertyEditing.Mac
PropertyViewModel viewModel;
internal PropertyViewModel ViewModel
{
- get { return viewModel; }
+ get { return this.viewModel; }
set {
if (this.viewModel != null) {
this.viewModel.PropertyChanged -= OnPropertyChanged;
}
this.viewModel = value;
+
if (this.viewModel != null) {
this.viewModel.PropertyChanged += OnPropertyChanged;
ValueSourceChanged (this.viewModel.ValueSource);
}
+
+ if (this.popUpContextMenu != null) {
+ this.popUpContextMenu.RemoveAllItems ();
+ this.popUpContextMenu = null;
+ }
}
}