private void ShowWindowList() { var contextMenu = new DockPaneMenu { DataContext = this, IsOpen = true, }; if (_windowListButton != null) { _windowListButton.IsChecked = true; contextMenu.Closed += (s, e) => _windowListButton.IsChecked = false; contextMenu.Placement = PlacementMode.Bottom; contextMenu.PlacementTarget = _windowListButton; } }