internal void ToggleTrailingSidebar() { NSSplitViewItem splitViewItem = (NSSplitViewItem)SplitViewItems.Last().Animator; TrailingSidebarViewWidthLayoutConstraint !.Active = false; NSAnimationContext.RunAnimation(changes: context => { context.Duration = 3; splitViewItem.Collapsed = !splitViewItem.Collapsed; }, completionHandler: () => { TrailingSidebarViewWidthLayoutConstraint.Active = true; }); }
void ClearControllers() { while (SplitViewItems.Length > 0) { var splitItem = SplitViewItems.Last(); var childVisualRenderer = splitItem.ViewController as ViewControllerWrapper; RemoveSplitViewItem(splitItem); IVisualElementRenderer render = null; if (childVisualRenderer.RendererWeakRef.TryGetTarget(out render)) { render.Dispose(); } childVisualRenderer.Dispose(); childVisualRenderer = null; } }