Exemplo n.º 1
0
        public MainMenuVM(ShellVM shell)
        {
            this.Shell = shell;

            this.NewMenuItems    = this.CreateViewModelMap(MenuAnchor.New, () => this.HasNewMenuItems);
            this.ExportMenuItems = this.CreateViewModelMap(MenuAnchor.Export, () => this.HasExportMenuItems);
            this.OpenMenuItems   = this.CreateViewModelMap(MenuAnchor.Open, () => this.HasOpenMenuItems);
            this.ViewMenuItems   = this.CreateViewModelMap(MenuAnchor.View, () => this.HasViewMenuItems);
            this.HelpMenuItems   = this.CreateViewModelMap(MenuAnchor.Help, () => this.HasHelpMenuItems);
            this.RootMenuItems   = this.CreateViewModelMap(MenuAnchor.Root, () => this.HasRootMenuItems);
            this.ToolsMenuItems  = this.CreateViewModelMap(MenuAnchor.Tools, () => this.HasToolsMenuItems);

            this.RecentDocuments = new ObservableCollection <MenuItemVM>();

            DockingViewManager.Instance.DocumentManager.ActiveDocumentChanged += DocumentManager_ActiveDocumentChanged;
        }
        public MainDockingViewVM(ShellVM shell, CommandBindingCollection commandBindings)
        {
            this.Shell       = shell;
            _commandBindings = commandBindings;

            this.Panels    = new ViewModelMap <PanelInfo, PanelVM>(DockingViewManager.Instance.Panels, p => new PanelVM(p));
            this.Documents = new ViewModelMap <DocumentInfo, DocumentVM>(DockingViewManager.Instance.Documents,
                                                                         d =>
            {
                var document = new DocumentVM(d);
                App.CompositionContainer.SatisfyImportsOnce(document);
                return(document);
            });

            this.Documents.CollectionChanged += Documents_CollectionChanged;

            DockingViewManager.Instance.DocumentSelected += DockingViewManager_DocumentSelected;
            DockingViewManager.Instance.DocumentManager.DocumentsRestored += DocumentManager_DocumentsRestored;

            _commandBindings.Add(new CommandBinding(ApplicationCommands.Close, this.ExecuteCloseCommmand, this.CanExecuteCloseCommand));
        }
Exemplo n.º 3
0
 public StatusVM(ShellVM shell)
 {
     this.Shell = shell;
     StatusManager.Instance.PropertyChanged += StatusManager_PropertyChanged;
     StatusManager.Instance.TaskManagers.CollectionChanged += TaskManagers_CollectionChanged;
 }
Exemplo n.º 4
0
 public ApplicationSettingsVM(ShellVM shell)
 {
     this.Shell = shell;
 }