From 776e7b4d72d55398e0f196d34a9d98893e8ab923 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Thu, 26 Aug 2021 01:31:10 -0400 Subject: Support PropertyPresenter being unloaded & reloaded When the property panel is hidden via the auto-hide button, controls are unloaded (the Unload event is generated). Then when it's reshown it's loaded again (Load event). This may be the only case where controls are loaded after being unloaded. Previously, the code didn't seem to assume reloads would happen, clearing out the DataContext on unload. But that seems wrong, as DataContext isn't reset on the load, which caused controls not to work (all be blank) in the panel hide/show scenario. Updated to no longer null out the DataContext on unload. That fixed this bug and doesn't seem to have any other ill effects. Fixes AB#1315193 --- Xamarin.PropertyEditing.Windows/PropertyPresenter.cs | 1 - 1 file changed, 1 deletion(-) mode change 100644 => 100755 Xamarin.PropertyEditing.Windows/PropertyPresenter.cs diff --git a/Xamarin.PropertyEditing.Windows/PropertyPresenter.cs b/Xamarin.PropertyEditing.Windows/PropertyPresenter.cs old mode 100644 new mode 100755 index 8d7211e..4cf1813 --- a/Xamarin.PropertyEditing.Windows/PropertyPresenter.cs +++ b/Xamarin.PropertyEditing.Windows/PropertyPresenter.cs @@ -168,7 +168,6 @@ namespace Xamarin.PropertyEditing.Windows private void OnUnloaded (object sender, RoutedEventArgs e) { IsSubProperty = false; - DataContext = null; } private void OnDataContextChanged (object sender, DependencyPropertyChangedEventArgs e) -- cgit v1.2.3