Пример #1
0
        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();
            }
        }
Пример #2
0
        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();
            }
        }
Пример #3
0
        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;
        }