public void Float(object parameter) { IBMenuItem from = parameter as IBMenuItem; if (from == null) { throw new IBDisableCommandException("コマンドターゲットが不正、または取得できません"); } ContextMenu cm = from.Parent as ContextMenu; if (cm == null) { throw new IBDisableCommandException("コマンドターゲットが不正、または取得できません"); } IBTabItem trg = cm.PlacementTarget as IBTabItem; if (trg == null) { throw new IBDisableCommandException("コマンドターゲットが不正、または取得できません"); } IBTabControl tc = trg.Parent as IBTabControl; if (tc == null) { throw new IBDisableCommandException("コマンドターゲットが不正、または取得できません"); } IBPanel panel = tc.Parent as IBPanel; if (panel == null) { throw new IBDisableCommandException("コマンドターゲットが不正、または取得できません"); } IBWindow ibw = new IBWindow(); ibw.InputBindings.AddRange(Application.Current.MainWindow.InputBindings); ibw.SetIBTabItem(trg); ibw.Show(); if (tc.Items.Count == 0) { panel.RemoveIBPanel(); } }
public void DoCloseCommand(object parameter) { IBMenuItem from = parameter as IBMenuItem; if (from == null) { throw new IBDisableCommandException("コマンドターゲットが不正、または取得できません"); } ContextMenu cm = from.Parent as ContextMenu; if (cm == null) { throw new IBDisableCommandException("コマンドターゲットが不正、または取得できません"); } IBTabItem trg = cm.PlacementTarget as IBTabItem; if (trg == null) { throw new IBDisableCommandException("コマンドターゲットが不正、または取得できません"); } IBTabControl tc = trg.Parent as IBTabControl; if (tc == null) { throw new IBDisableCommandException("コマンドターゲットが不正、または取得できません"); } IBPanel panel = tc.Parent as IBPanel; if (panel == null) { throw new IBDisableCommandException("コマンドターゲットが不正、または取得できません"); } trg.RemoveFromParent(); if (tc.Items.Count == 0) { panel.RemoveIBPanel(); } }
public void ShowTitleBar(object parameter) { IBMenuItem from = parameter as IBMenuItem; if (from == null) { throw new IBDisableCommandException("コマンドターゲットが不正、または取得できません"); } ContextMenu cm = from.Parent as ContextMenu; if (cm == null) { throw new IBDisableCommandException("コマンドターゲットが不正、または取得できません"); } IBTabItem trg = cm.PlacementTarget as IBTabItem; if (trg == null) { throw new IBDisableCommandException("コマンドターゲットが不正、または取得できません"); } trg.Height = double.NaN; }