private void Tab_OnAttachDetachWindow(object sender, BaseTabViewModel e)
        {
            var window = new MainTabWindow(new MainTabWindowViewModel(e, e.TabHeader, e.TabIcon, vm =>
            {
                AddTab(e);
                vm.CloseView();
            }));

            window.Show();
            e.CloseView();
        }
        public void AddTab(BaseTabViewModel tab)
        {
            if (tab != null)
            {
                tab.OnTabCreation        += (s, t) => AddTab(t);
                tab.OnCreateNewTab       += (s, t, p) => AddTab(m_TabFactoryService.CreateTab(t, p));
                tab.OnRequestClose       += OnTabClosed;
                tab.OnAttachDetachWindow += Tab_OnAttachDetachWindow;
                Tabs.Insert(Tabs.Count - 1, tab);
                SelectedTab = tab;

                if (!KeepNewTab)
                {
                    AddNewTab();
                }
            }
        }
 public void SelectNewTab()
 {
     SelectedTab = m_NewTab;
 }
Esempio n. 4
0
 public void CreateNewTab(BaseTabViewModel tab)
 {
     OnTabCreation(this, tab);
 }