diff options
author | Dominique Louis <dolouis@microsoft.com> | 2019-11-07 23:44:21 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-07 23:44:21 +0300 |
commit | 70e8074aa62c2030cd60c68f963beb62abc2a5be (patch) | |
tree | c2c40138117eb9e2e6c304e8f9bf0239926ad670 | |
parent | a81ae7cfb70a2920b7838ff40c19b85cb4d56bf9 (diff) | |
parent | 0c992ff12e1398ec307d2309769575f10ac82799 (diff) |
Merge pull request #680 from xamarin/ermau-fix-no-window
[mac] Use more reliable row removed notice
-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; |