diff options
author | Eric Maupin <ermaup@microsoft.com> | 2018-03-01 00:13:37 +0300 |
---|---|---|
committer | Eric Maupin <ermaup@microsoft.com> | 2018-03-01 00:13:39 +0300 |
commit | 64e6fa53b94b7f633ece69b528437613acec3c19 (patch) | |
tree | 02d53815fd66b2c28cbfcdf84febf616ee08d082 /Xamarin.PropertyEditing.Windows | |
parent | b72f867a53c73a1f3777253f7eb6abdd37ed9463 (diff) |
[Win] Fix NRE in ChoiceControl on unload
In VS, unloading controls seems to want to unset their styles and
therefore their templates which triggers updates not seen in the
standalone app.
This fixes the container generator status change when the template is
changed to null. When it's null we don't care about the contents so
we'll just return.
Diffstat (limited to 'Xamarin.PropertyEditing.Windows')
-rw-r--r-- | Xamarin.PropertyEditing.Windows/ChoiceControl.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Xamarin.PropertyEditing.Windows/ChoiceControl.cs b/Xamarin.PropertyEditing.Windows/ChoiceControl.cs index 00c6721..4eb7376 100644 --- a/Xamarin.PropertyEditing.Windows/ChoiceControl.cs +++ b/Xamarin.PropertyEditing.Windows/ChoiceControl.cs @@ -102,7 +102,7 @@ namespace Xamarin.PropertyEditing.Windows private void OnItemContainerGeneratorOnStatusChanged (object sender, EventArgs args) { - if (ItemContainerGenerator.Status != GeneratorStatus.ContainersGenerated) + if (ItemContainerGenerator.Status != GeneratorStatus.ContainersGenerated || (ItemTemplate == null && ItemTemplateSelector == null)) return; // Note: this does not handle a changing items ItemsSource. It's not something that's currently required and unlikely to be. |