Пример #1
0
        /// <summary>
        /// タブを指定したタブの前に追加します。
        /// </summary>
        /// <param name="insert">追加するタブ</param>
        /// <param name="beforeThis">このタブの前に追加、nullなら末尾に追加</param>
        public void InsertBefore(TabViewModel insert, TabViewModel beforeThis)
        {
            // インデックス取得
            int idx = -1;

            if (beforeThis != null)
            {
                idx = this._tabItems.IndexOf(beforeThis);
            }

            if (idx == -1)
            {
                this._tabItems.Add(insert);
            }
            else
            {
                this._tabItems.Insert(idx, insert);
            }

            // タブの保持カラムを更新し、イベントハンドラを連結する
            insert.SetTabOwner(this);
            insert.GotFocus += OnTabGotFocus;

            // 一つ目のタブであればそのタブを選択する
            if (this._tabItems.Count == 1)
            {
                SelectedTabViewModel = insert;
            }

            // タブ変更のコミット
            insert.InvalidateCache();
        }
Пример #2
0
 public void EditTab(TabViewModel vm)
 {
     vm.TabProperty = ShowTabEditor(vm.TabProperty);
     vm.InvalidateTabProperty();
     vm.InvalidateCache();
 }
Пример #3
0
        /// <summary>
        /// タブを指定したタブの前に追加します。
        /// </summary>
        /// <param name="insert">追加するタブ</param>
        /// <param name="beforeThis">このタブの前に追加、nullなら末尾に追加</param>
        public void InsertBefore(TabViewModel insert, TabViewModel beforeThis)
        {
            // インデックス取得
            int idx = -1;
            if (beforeThis != null)
                idx = this._tabItems.IndexOf(beforeThis);

            if (idx == -1)
                this._tabItems.Add(insert);
            else
                this._tabItems.Insert(idx, insert);

            // タブの保持カラムを更新し、イベントハンドラを連結する
            insert.SetTabOwner(this);
            insert.GotFocus += OnTabGotFocus;

            // 一つ目のタブであればそのタブを選択する
            if (this._tabItems.Count == 1)
                SelectedTabViewModel = insert;

            // タブ変更のコミット
            insert.InvalidateCache();
        }
Пример #4
0
 public void EditTab(TabViewModel vm)
 {
     vm.TabProperty = ShowTabEditor(vm.TabProperty);
     vm.InvalidateTabProperty();
     vm.InvalidateCache();
 }