public static void Execute(DockItem dockItem, DockItemShowMethod showMethod) { DockControl dockControl = dockItem.DockControl; if (dockControl.CanEnterUndo) { dockControl.ExecuteCommand(new ToggleAutoHideCommand(dockItem, showMethod)); } else { dockItem.DoToggleAutoHide(showMethod); } }