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-10-01 18:15:26 +0300
committerEric Maupin <ermaup@microsoft.com>2019-10-01 18:15:30 +0300
commita6744fa36ba419ada63beaa1b54a78b084b5f392 (patch)
tree0abbbedc03f706963881d0f431a5ad7987aa2fa0 /Xamarin.PropertyEditing.Mac/Controls
parent2b789a918bcfe3ad9fcbe5443839d9c7bebd5b3c (diff)
[mac] Ignore change events if no resources
Seems like we might be getting chang events even when not visible so let's ignore them if we don't actually have a resource selector. The search box gets added regardless to simplify putting it at the end.
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/Controls')
-rw-r--r--Xamarin.PropertyEditing.Mac/Controls/Custom/BrushTabViewController.cs15
1 files changed, 10 insertions, 5 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/BrushTabViewController.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/BrushTabViewController.cs
index 08cea38..7dad34d 100644
--- a/Xamarin.PropertyEditing.Mac/Controls/Custom/BrushTabViewController.cs
+++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/BrushTabViewController.cs
@@ -29,11 +29,7 @@ namespace Xamarin.PropertyEditing.Mac
PlaceholderString = Properties.Resources.SearchResourcesTitle,
};
- this.filterResource.Changed += (sender, e) => {
- ViewModel.ResourceSelector.FilterText = this.filterResource.Cell.Title;
- this.resource.ReloadData ();
- };
-
+ this.filterResource.Changed += OnResourceFilterChanged;
this.filterResource.Hidden = true;
TabStack.AddView (this.filterResource, NSStackViewGravity.Leading);
@@ -194,5 +190,14 @@ namespace Xamarin.PropertyEditing.Mac
private NSSearchField filterResource;
private ResourceBrushViewController resource;
+
+ private void OnResourceFilterChanged (object sender, EventArgs e)
+ {
+ if (ViewModel.ResourceSelector == null)
+ return;
+
+ ViewModel.ResourceSelector.FilterText = this.filterResource.Cell.Title;
+ this.resource.ReloadData ();
+ }
}
}