public INewTabHost <Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { //When tearing a windows, create a new main window var view = ServiceLocator.Current.GetInstance <MainWindow>(); return(new NewTabHost <Window>(view, view.TabablzControl)); }
public INewTabHost <Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { var view = new TemplateWindow(); view.DataContext = source.DataContext; return(new NewTabHost <Window>(view, view.TabablzControl)); }
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; }
public INewTabHost<Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { var window = _factory.Create(); return new NewTabHost<Window>(window, window.InitialTabablzControl); }
public WindowViewModel(IObjectProvider objectProvider, IWindowFactory windowFactory) { _objectProvider = objectProvider; _interTabClient = new InterTabClient(windowFactory); _showMenuCommand = new Command(ShowMenu,()=> Selected!=null && !(Selected.Content is MenuItems)); _showInGitHubCommand = new Command(()=> Process.Start("https://github.com/RolandPheasant")); var menuController = _data.ToObservableChangeSet() .Filter(vc => vc.Content is MenuItems) .Transform(vc => (MenuItems) vc.Content) .MergeMany(menuItem => menuItem.ItemCreated) .Subscribe(item => { _data.Add(item); Selected = item; }); _cleanUp = Disposable.Create(() => { menuController.Dispose(); foreach (var disposable in _data.Select(vc=>vc.Content).OfType<IDisposable>()) disposable.Dispose(); }); }
public INewTabHost <Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { var window = _factory.Create(); return(new NewTabHost <Window>(window, window.InitialTabablzControl)); }
public WindowViewModel( ViewContainer.Factory viewContainerFactory, MenuBuilder.Factory menuItemsFactory, IInterTabClient interTabClient) { _viewContainerFactory = viewContainerFactory; _menuItemsFactory = menuItemsFactory; InterTabClient = interTabClient; _showMenuCommand = ReactiveCommand.Create(ShowMenu, Observable.Return <bool>(Selected != null && !(Selected.Content is MenuBuilder))); ShowInGitHubCommand = ReactiveCommand.Create(() => Process.Start("https://github.com/RolandPheasant")); var menuController = Views.ToObservableChangeSet() .Filter(vc => vc.Content is MenuBuilder) .Transform(vc => (MenuBuilder)vc.Content) .MergeMany(menuItems => menuItems.ItemCreated) .Subscribe(item => { Views.Add(item); Selected = item; }); _cleanUp = Disposable.Create(() => { menuController.Dispose(); foreach (var disposable in Views.Select(vc => vc.Content).OfType <IDisposable>()) { disposable.Dispose(); } }); }
public WindowViewModel(IObjectProvider objectProvider, IWindowFactory windowFactory) { _objectProvider = objectProvider; _interTabClient = new InterTabClient(windowFactory); _showMenuCommand = new Command(ShowMenu, () => Selected != null && !(Selected.Content is MenuItems)); _showInGitHubCommand = new Command(() => Process.Start("https://github.com/RolandPheasant")); var menuController = _data.ToObservableChangeSet() .Filter(vc => vc.Content is MenuItems) .Transform(vc => (MenuItems)vc.Content) .MergeMany(menuItem => menuItem.ItemCreated) .Subscribe(item => { _data.Add(item); Selected = item; }); _cleanUp = Disposable.Create(() => { menuController.Dispose(); foreach (var disposable in _data.Select(vc => vc.Content).OfType <IDisposable>()) { disposable.Dispose(); } }); }
public INewTabHost<Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { var window = new Window(); var tabControl = new AB_DockingTabControl(); window.Content = tabControl; return new NewTabHost<Window>(window, tabControl); }
public INewTabHost <Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { var childWindow = new ChildWindow(); childWindow.TabablzControl.Items.Clear(); return(new NewTabHost <Window>(childWindow, childWindow.TabablzControl)); }
public INewTabHost <Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { ChildWindow childWindow = new ChildWindow(); var us = (UserControl)source.SelectedContent; var sz = new Size(us.ActualWidth + 10, us.ActualHeight + 80); childWindow = new ChildWindow(sz); //if (source.SelectedContent.GetType().Name == typeof(ScrappView).Name) { // sz = new Size(280, 120); // childWindow = new ChildWindow(sz); //}else // if (source.SelectedContent.GetType().Name == typeof(PainelElementoView).Name) // { // sz = new Size(650, 500); // childWindow = new ChildWindow(sz); // }else //if (source.SelectedContent.GetType().Name == typeof(ConsultaCaso).Name) //{ // sz = new Size(250, 500); // childWindow = new ChildWindow(sz); //}else //if (source.SelectedContent.GetType().Name == typeof(PainelElementoInfo).Name) //{ // sz = new Size(500, 300); // childWindow = new ChildWindow(sz); //} var nw = new NewTabHost <Window>(childWindow, childWindow.ChildWindowTabablzControl); return(nw); }
INewTabHost <Window> IInterTabClient.GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { StyledWindow window = StyledWindow.Create <TornTabView>(); window.OverlapTitleBar = true; return(new NewTabHost <Window>(window, ((TornTabView)window.Content).InitialTabablzControl)); }
public INewTabHost<Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { var view = new BasicExampleTemplateWindow(); var model = new BasicExampleTemplateModel(interTabClient, partition); view.DataContext = model; return new NewTabHost<Window>(view, view.TabablzControl); }
public INewTabHost <Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { if (SourceTabablzControl == null) { SourceTabablzControl = source; SourceTabablzControl.IsVisibleChanged += SourceTabablzControl_IsVisibleChanged; } var window = new DragablzWindow(); window.Height = source.ActualHeight; window.Width = source.ActualWidth; window.WindowState = WindowState.Normal; window.SizeChanged += Window_SizeChanged; window.StateChanged += Window_StateChanged; var tabControl = new TabablzControl(); window.Content = tabControl; var newTabHost = new NewTabHost <Window>(window, tabControl); NewTabHosts.Add(newTabHost); window.Closed += Window_Closed; return(newTabHost); }
public TearedShellViewModel( IInterTabClient interTabClient, IInterLayoutClient interLayoutClient) { InterTabClient = interTabClient; InterLayoutClient = interLayoutClient; }
public virtual INewTabHost <Window> GetNewHost(IInterTabClient interTabClient, object partition, DockControl source) { if (source == null) { throw new ArgumentNullException(nameof(source)); } var sourceWindow = source.GetSelfAndVisualAncestors().OfType <Window>().First(); if (sourceWindow == null) { throw new ApplicationException("Unable to ascrtain source window."); } var newHost = (Window)Activator.CreateInstance(sourceWindow.GetType()); Dispatcher.UIThread.InvokeAsync(new Action(() => { }), DispatcherPriority.DataBind); var newDockControl = newHost.GetSelfAndLogicalAncestors().OfType <DockControl>().FirstOrDefault(); if (newDockControl == null) { throw new ApplicationException("Unable to ascrtain tab control."); } return(new NewTabHost <Window>(newHost, newDockControl)); }
public INewTabHost<Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { var view = new MainWindow(); var model = new MainWindowViewModel(); view.DataContext = model; return new NewTabHost<Window>(view, view.TabablzControl); }
public TraderWindowModel(IObjectProvider objectProvider,TraderWindowFactory traderWindowFactory ) { _objectProvider = objectProvider; _interTabClient = new InterTabClient(traderWindowFactory); _showMenu = new Command(OnShowMenu); var menuController = _data.AsObservable(vc => vc.Id) .Filter(vc => vc.Content is MenuItems) .Transform(vc => (MenuItems) vc.Content) .MergeMany(menuItem => menuItem.ItemCreated) .Subscribe(item => { _data.Add(item); Selected = item; }); _cleanUp = Disposable.Create(() => { menuController.Dispose(); foreach (var disposable in _data.Select(vc=>vc.Content).OfType<IDisposable>()) disposable.Dispose(); _newMenuItemSubscriber.Dispose(); }); }
public virtual INewTabHost <Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { if (source == null) { throw new ArgumentNullException("source"); } var sourceWindow = Window.GetWindow(source); if (sourceWindow == null) { throw new ApplicationException("Unable to ascertain source window."); } var newWindow = (Window)Activator.CreateInstance(sourceWindow.GetType()); newWindow.Dispatcher.Invoke(new Action(() => { }), DispatcherPriority.DataBind); var newTabablzControl = newWindow.LogicalTreeDepthFirstTraversal().OfType <TabablzControl>().FirstOrDefault(); if (newTabablzControl == null) { throw new ApplicationException("Unable to ascertain tab control."); } if (newTabablzControl.ItemsSource == null) { newTabablzControl.Items.Clear(); } return(new NewTabHost <Window>(newWindow, newTabablzControl)); }
/// <summary> /// Create a new <see cref="SigmaWindow" /> when a tab is dragged out. /// Provide a new host window so a tab can be teared from an existing window into /// a new window. /// </summary> /// <param name="interTabClient"></param> /// <param name="partition">Provides the partition where the drag operation was initiated.</param> /// <param name="source">The source control where a dragging operation was initiated.</param> /// <returns></returns> public INewTabHost <Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { TWindow window = Construct(new[] { typeof(WPFMonitor), typeof(Application), typeof(string), typeof(TWindow) }, new object[] { _monitor, _app, _title, _monitor.Window }); return(new NewTabHost <WPFWindow>(window, window.TabControl.InitialTabablzControl)); }
public TraderWindowModel(IObjectProvider objectProvider, TraderWindowFactory traderWindowFactory) { _objectProvider = objectProvider; _interTabClient = new InterTabClient(traderWindowFactory); _showMenu = new Command(OnShowMenu); var menuController = _data.AsObservable(vc => vc.Id) .Filter(vc => vc.Content is MenuItems) .Transform(vc => (MenuItems)vc.Content) .MergeMany(menuItem => menuItem.ItemCreated) .Subscribe(item => { _data.Add(item); Selected = item; }); _cleanUp = Disposable.Create(() => { menuController.Dispose(); foreach (var disposable in _data.Select(vc => vc.Content).OfType <IDisposable>()) { disposable.Dispose(); } _newMenuItemSubscriber.Dispose(); }); }
public INewTabHost <Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { MainWindow window = new MainWindow(fullscreen: false); MainPage mainPage = window.GetMainPage(); return(new NewTabHost <Window>(window, mainPage.tcMainTabControl)); }
public INewTabHost<Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { var view = new TabWindow(); view.AllowsTransparency = true; view.WindowStyle = WindowStyle.None; return new NewTabHost<TabWindow>(view, view.InitialTabablzControl); }
public INewTabHost<Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { var childWindow = new ChildWindow(); childWindow.TabablzControl.Items.Clear(); return new NewTabHost<Window>(childWindow, childWindow.TabablzControl); }
public INewTabHost <Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { var view = new BoundExampleWindow(); var model = new BoundExampleModel(); view.DataContext = model; return(new NewTabHost <Window>(view, view.InitialTabablzControl)); }
public INewTabHost <Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { MainWindow view = new(); var model = ChromEr.Instance.CreateMainViewModel(new List <DirectoryTabItemViewModel>()); view.DataContext = model; return(new NewTabHost <Window>(view, view.InitMainView.InitialTabablzControl)); }
public INewTabHost <Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { var viewModel = viewModelFactory.CreateViewModel <MainWindowViewModel>(); var window = new MainWindow(); window.DataContext = viewModel; return(new NewTabHost <MainWindow>(window, window.TabablzControl)); }
public INewTabHost <Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { var win = new MainWindow(); var vm = new MainViewModel(false, new IWindowImpl(win)); win.DataContext = vm; return(new NewTabHost <Window>(win, win.MainView.TabablzControl)); }
public INewTabHost <Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { var view = new TabWindow(); view.AllowsTransparency = true; view.WindowStyle = WindowStyle.None; return(new NewTabHost <TabWindow>(view, view.InitialTabablzControl)); }
public INewTabHost <Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { var view = new BasicExampleTemplateWindow(); var model = new BasicExampleTemplateModel(interTabClient, partition); view.DataContext = model; return(new NewTabHost <Window>(view, view.TabablzControl)); }
/// <summary> /// Implementation of InterTabClient. /// To open dragged tabs in a different window class than they originated from. /// </summary> /// <param name="interTabClient">InterTabClient</param> /// <param name="partition">Partition</param> /// <param name="source">Source</param> /// <returns>Tab host.</returns> public INewTabHost <Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { TabWindow view = new TabWindow(); view.Owner = App.Current.MainWindow; TControl = source; view.Closing += new CancelEventHandler(CloseWindow); return(new NewTabHost <Window>(view, view.TabablzControl)); //TabablzControl is a names control in the XAML. }
public MainWindowViewModel(IRegionManager regionManager) { this.regionManager = regionManager; OpenView1 = new DelegateCommand(OpenView1Action); OpenView2 = new DelegateCommand(OpenView2Action); OpenView3 = new DelegateCommand(OpenView3Action); InterTabClient = new InterTabClient(); }
public override INewTabHost <Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { // We hold the only backend in DataContext on all MainWindow (host). // We need to copy it to the new window. var host = base.GetNewHost(interTabClient, partition, source); host.Container.DataContext = Window.GetWindow(source).DataContext; return(host); }
public INewTabHost <Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { var view = new TabShellWindow(); view.TabsContainer.InterTabController = new InterTabController { InterTabClient = interTabClient }; return(new NewTabHost <Window>(view, view.TabsContainer)); }
public ShellViewModel( IInterTabClient interTabClient, IInterLayoutClient interLayoutClient) { InterTabClient = interTabClient; InterLayoutClient = interLayoutClient; Items.Add(new TabContentViewModel(1)); Items.Add(new TabContentViewModel(2)); Items.Add(new TabContentViewModel(3)); }
public MainWindowViewModel() { InterTabClient = new MainInterTabClient(); contentList = new List <UIElement>(); projects = new ObservableCollection <Views.Controls.Project>(); contentList.Add(new Dashboard()); contentList.Add(new Projects()); contentList.Add(new Reports()); ContentIndex = 0; }
public INewTabHost <Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { var shell = new MainView(); shell.Title = DisplayName; var vm = IoC.Get <UserControl2ViewModel>(); ViewModelBinder.Bind(vm, shell, null); return(new NewTabHost <MetroWindow>(shell, shell.Items)); }
public BasicExampleMainModel() { _basicColourMonitor = new PositionMonitor(); _basicColourMonitor.LocationChanged += (sender, args) => BasicColourMonitorText = args.Location.ToString(); _peopleMonitor = new VerticalPositionMonitor(); _peopleMonitor.OrderChanged += PeopleMonitorOnOrderChanged; _people.Add(new Person { FirstName = "Albert", LastName = "Einstein" }); _people.Add(new Person { FirstName = "Neil", LastName = "Tyson" }); _people.Add(new Person { FirstName = "James", LastName = "Willock" }); //i move in esteemed circles ;) _viewModels.Add(new SimpleViewModel { Name = "Alpha", SimpleContent = "This is the alpha content" }); _viewModels.Add(new SimpleViewModel { Name = "Beta", SimpleContent = "Beta content", IsSelected = true }); _viewModels.Add(new SimpleViewModel { Name = "Gamma", SimpleContent = "And here is the gamma content" }); SelectedViewModel = _viewModels[1]; _interTabClient = new BasicExampleInterTabClient(); _addNewPerson = new AnotherCommandImplementation( x => { _newPersonCount++; _people.Add(new Person { FirstName = "Hello_" + _newPersonCount, LastName = "World_" + _newPersonCount }); }); _addNewViewModel = new AnotherCommandImplementation( x => { _newViewModelCount++; _viewModels.Add(new SimpleViewModel() { Name = "New Tab " + _newViewModelCount, SimpleContent = "New Tab Content " + _newViewModelCount }); SelectedViewModel = _viewModels.Last(); }); }
public INewTabHost <Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { var shell = new MainView(); shell.Title = this.DisplayName; //shell.InitializeComponent(); // Only required if you don't have ShellView.xaml.cs var vm = IoC.Get <UserControl1ViewModel>(); ViewModelBinder.Bind(vm, shell, null); return(new NewTabHost <MetroWindow>(shell, shell.Items)); }
public MainWindow(IKernel kernel, IGameConnection connection, IInterTabClient interTab, IInterLayoutClient interLayout, IProjectManager projectManager) { _kernel = kernel; _connection = connection; _interTabClient = interTab; _interLayoutClient = interLayout; _projectManager = projectManager; InitializeComponent(); Loaded += WindowLoaded; }
public virtual INewTabHost<Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { if (source == null) { throw new ArgumentNullException("source"); } var sourceWindow = Window.GetWindow(source); if (sourceWindow == null) { throw new ApplicationException("Unable to ascrtain source window."); } return new NewTabHost<Window>(sourceWindow, source); }
public virtual INewTabHost<Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { if (source == null) throw new ArgumentNullException("source"); var sourceWindow = Window.GetWindow(source); if (sourceWindow == null) throw new ApplicationException("Unable to ascrtain source window."); var newWindow = (Window)Activator.CreateInstance(sourceWindow.GetType()); newWindow.Dispatcher.Invoke(new Action(() => { }), DispatcherPriority.DataBind); var newTabablzControl = newWindow.LogicalTreeDepthFirstTraversal().OfType<TabablzControl>().FirstOrDefault(); if (newTabablzControl == null) throw new ApplicationException("Unable to ascrtain tab control."); newTabablzControl.Items.Clear(); return new NewTabHost<Window>(newWindow, newTabablzControl); }
public BasicExampleMainModel() { _basicColourMonitor = new PositionMonitor(); _basicColourMonitor.LocationChanged += (sender, args) => BasicColourMonitorText = args.Location.ToString(); _peopleMonitor = new VerticalPositionMonitor(); _peopleMonitor.OrderChanged += PeopleMonitorOnOrderChanged; _people.Add(new Person {FirstName = "Albert", LastName = "Einstein"}); _people.Add(new Person { FirstName = "Neil", LastName = "Tyson" }); _people.Add(new Person { FirstName = "James", LastName = "Willock" }); //i move in esteemed circles ;) _viewModels.Add(new SimpleViewModel { Name = "Alpha", SimpleContent = "This is the alpha content"}); _viewModels.Add(new SimpleViewModel { Name = "Beta", SimpleContent = "Beta content", IsSelected = true }); _viewModels.Add(new SimpleViewModel { Name = "Gamma", SimpleContent = "And here is the gamma content" }); SelectedViewModel = _viewModels[1]; _interTabClient = new BasicExampleInterTabClient(); _addNewPerson = new AnotherCommandImplementation( x => { _newPersonCount++; _people.Add(new Person { FirstName = "Hello_" + _newPersonCount, LastName = "World_" + _newPersonCount }); }); _addNewViewModel = new AnotherCommandImplementation( x => { _newViewModelCount++; _viewModels.Add(new SimpleViewModel() { Name = "New Tab " + _newViewModelCount, SimpleContent = "New Tab Content " + _newViewModelCount }); SelectedViewModel = _viewModels.Last(); }); }
public INewTabHost<Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { if (SourceTabablzControl == null) { SourceTabablzControl = source; SourceTabablzControl.IsVisibleChanged += SourceTabablzControl_IsVisibleChanged; } var window = new DragablzWindow(); window.Height = source.ActualHeight; window.Width = source.ActualWidth; window.WindowState = WindowState.Normal; window.SizeChanged += Window_SizeChanged; window.StateChanged += Window_StateChanged; var tabControl = new TabablzControl(); window.Content = tabControl; var newTabHost = new NewTabHost<Window>(window, tabControl); NewTabHosts.Add(newTabHost); window.Closed += Window_Closed; return newTabHost; }
public INewTabHost<Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { if (SourceTabablzControl == null) { SourceTabablzControl = source; SourceTabablzControl.IsVisibleChanged += SourceTabablzControl_IsVisibleChanged; } var window = new DragablzWindow {WindowState = WindowState.Normal}; window.SizeChanged += Window_SizeChanged; window.StateChanged += Window_StateChanged; var tabControl = new TabablzControl { InterTabController = new InterTabController {InterTabClient = new DockableTabInterTabClient()} }; window.Content = tabControl; var newTabHost = new NewTabHost<Window>(window, tabControl); NewTabHosts.Add(newTabHost); window.Closed += Window_Closed; return newTabHost; }
public INewTabHost<Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { var view = new ShellViewModel(false).View; return new NewTabHost<Window>(view, view.ShellTabablzControl); }
public InterLayoutClient(IInterTabClient interTabClient) { _interTabClient = interTabClient; }
public INewTabHost<Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { var view = ServiceLocator.Current.GetInstance<MainWindow>(); return new NewTabHost<Window>(view, view.TabablzControl); }
public MainWindowViewModel() { _interTabClient = new DefaultInterTabClient(); }
public BasicExampleTemplateModel(IInterTabClient interTabClient, object partition) { _interTabClient = interTabClient; _partition = partition; }
public INewTabHost<Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { var view = _kernel.Get<MainWindow>(); return new NewTabHost<MainWindow>(view, view.InitialTabablzControl); }