Esempio n. 1
0
        public INewTabHost<Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source)
        {
            TabControlVM tcvm = new TabControlVM();
            TabWindowVM twvm = new TabWindowVM() { };
            twvm.TabControlVMs.Add(tcvm);
            InterTabWindow view = new InterTabWindow(twvm);

            Window window = Window.GetWindow(source);
            TabControlVM tvm = (TabControlVM)source.DataContext;
            MainWindowVM mvm = null;
            if(window is MainWindow)
            {
                mvm = (window as MainWindow).MainWindowVM;
                if (tvm.TabPanelVMs.Count == 1)
                {
                    mvm.TabPanelManagerVM.TabControlVMs.Remove(tvm);
                }
            }
            else if(window is InterTabWindow)
            {
                mvm = (window as InterTabWindow).MainWindowVM;
                if (tvm.TabPanelVMs.Count == 1)
                {
                    (window as InterTabWindow).TabWindowVM.TabControlVMs.Remove(tvm);
                }
            }
            view.MainWindowVM =mvm;
            view.MainWindowVM.TabPanelManagerVM.TabWindowVMs.Add(view.TabWindowVM);

            NewTabHost<InterTabWindow> th= new  NewTabHost<InterTabWindow>(view, view.TabablzControl) ;
            return th;
        }
Esempio n. 2
0
        public INewTabHost <Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source)
        {
            TabControlVM tcvm = new TabControlVM();
            TabWindowVM  twvm = new TabWindowVM()
            {
            };

            twvm.TabControlVMs.Add(tcvm);
            InterTabWindow view = new InterTabWindow(twvm);

            Window       window = Window.GetWindow(source);
            TabControlVM tvm    = (TabControlVM)source.DataContext;
            MainWindowVM mvm    = null;

            if (window is MainWindow)
            {
                mvm = (window as MainWindow).MainWindowVM;
                if (tvm.TabPanelVMs.Count == 1)
                {
                    mvm.TabPanelManagerVM.TabControlVMs.Remove(tvm);
                }
            }
            else if (window is InterTabWindow)
            {
                mvm = (window as InterTabWindow).MainWindowVM;
                if (tvm.TabPanelVMs.Count == 1)
                {
                    (window as InterTabWindow).TabWindowVM.TabControlVMs.Remove(tvm);
                }
            }
            view.MainWindowVM = mvm;
            view.MainWindowVM.TabPanelManagerVM.TabWindowVMs.Add(view.TabWindowVM);

            NewTabHost <InterTabWindow> th = new  NewTabHost <InterTabWindow>(view, view.TabablzControl);

            return(th);
        }
Esempio n. 3
0
        public INewTabHost <UIElement> GetNewHost(object partition, TabablzControl source)
        {
            TabControlVM   vm = new TabControlVM();
            InterTabWindow mw = (InterTabWindow)Window.GetWindow(source);

            mw.TabWindowVM.TabControlVMs.Add(vm);
            var tabablzControl = new TabablzControl {
                DataContext = vm
            };

            tabablzControl.ItemsSource = vm.TabPanelVMs;

            Clone(source, tabablzControl);

            var newInterTabController = new InterTabController
            {
                Partition = source.InterTabController.Partition
            };

            Clone(source.InterTabController, newInterTabController);
            tabablzControl.SetCurrentValue(TabablzControl.InterTabControllerProperty, newInterTabController);

            return(new NewTabHost <UIElement>(tabablzControl, tabablzControl));
        }