diff options
author | Eric Maupin <ermaup@microsoft.com> | 2019-11-07 22:32:09 +0300 |
---|---|---|
committer | Eric Maupin <ermaup@microsoft.com> | 2019-11-07 22:32:11 +0300 |
commit | 0c992ff12e1398ec307d2309769575f10ac82799 (patch) | |
tree | 2e67d5fa9f5035163adf8155d42e91fda1264bc1 /Xamarin.PropertyEditing.Mac | |
parent | 8790fdf0dad435fae13a3a3e79e0a066e83c7945 (diff) |
[mac] Use more reliable row removed notice
This method seems far more reliable for noticing when rows are removed so
we can use it instead of changing to null superview (which sometimes it
doesn't do).
Diffstat (limited to 'Xamarin.PropertyEditing.Mac')
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/EditorContainer.cs | 8 | ||||
-rw-r--r-- | Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs | 7 |
2 files changed, 7 insertions, 8 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/EditorContainer.cs b/Xamarin.PropertyEditing.Mac/Controls/EditorContainer.cs index c22e438..2fee93f 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/EditorContainer.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/EditorContainer.cs @@ -55,14 +55,6 @@ namespace Xamarin.PropertyEditing.Mac } } - public override void ViewWillMoveToSuperview (NSView newSuperview) - { - if (newSuperview == null) - ViewModel = null; - - base.ViewWillMoveToSuperview (newSuperview); - } - #if DEBUG // Currently only used to highlight which controls haven't been implemented public NSColor LabelTextColor { set { LabelControl.TextColor = value; } diff --git a/Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs b/Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs index 49f2665..a322768 100644 --- a/Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs +++ b/Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs @@ -184,6 +184,13 @@ namespace Xamarin.PropertyEditing.Mac } } + public override void DidRemoveRowView (NSOutlineView outlineView, NSTableRowView rowView, nint row) + { + if (rowView.Subviews[0] is EditorContainer ec) { + ec.ViewModel = null; + } + } + public override nfloat GetRowHeight (NSOutlineView outlineView, NSObject item) { EditorViewModel vm; |