protected override void OnDockStateChanged(EventArgs e) { base.OnDockStateChanged(e); Sidebar sidebar = view as Sidebar; if (sidebar != null) { if (this.DockState == DockState.DockLeftAutoHide || this.DockState == DockState.DockRightAutoHide) { sidebar.Collapsed = true; } else { sidebar.Collapsed = false; } } }