public ToolbarPositionSettings(IEventAggregator eventAggregator, IShellToolbarService toolbarService)
        {
            eventAggregator.GetEvent <WindowClosingEvent>().Subscribe(SaveToolbarPositions);
            _toolTray = toolbarService as DefaultToolbar;
            _loadDict = new Dictionary <string, ToolbarSettingItem>();

            if (this.Toolbars != null && this.Toolbars.Count > 0)
            {
                foreach (var setting in this.Toolbars)
                {
                    _loadDict[setting.Key] = setting;
                }

                for (int i = 0; i < _toolTray.Children.Count; i++)
                {
                    DefaultToolbar tb = _toolTray.Children[i] as DefaultToolbar;
                    if (_loadDict.ContainsKey(tb.Key))
                    {
                        ToolbarSettingItem item = _loadDict[tb.Key];
                        tb.Band      = item.Band;
                        tb.BandIndex = item.BandIndex;
                        tb.IsChecked = item.IsChecked;
                        tb.Refresh();
                    }
                }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// The generic workspace that will be used if the application does not have its workspace
 /// </summary>
 /// <param name="container">The injected container - can be used by custom flavors of workspace</param>
 /// <param name="eventAggregator">The event aggregator.</param>
 public Workspace(IEventAggregator eventAggregator,
                  IMenuService menuService,
                  IShellToolbarService shellToolbarService,
                  IStatusbarService statusbarService,
                  ICommandManager commandManager)
     : base(eventAggregator, menuService, shellToolbarService, statusbarService, commandManager)
 {
 }
Exemplo n.º 3
0
        //private MjolnirApp _applicationDefinition;

        //[JsonIgnore]
        //public ImageSource Icon
        //{
        //    get
        //    {
        //        return _applicationDefinition.ApplicationIconSource;
        //    }
        //}

        //[JsonIgnore]
        //public string Title
        //{
        //    get
        //    {
        //        return _applicationDefinition.ApplicationName;
        //    }
        //}

        #endregion

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="DefaultWorkspace" /> class.
        /// </summary>
        /// <param name="container">The injected container.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        protected DefaultWorkspace(IEventAggregator eventAggregator,
                                   IMenuService menuService,
                                   IShellToolbarService shellToolbarService,
                                   IStatusbarService statusbarService,
                                   ICommandManager commandManager)
        {
            _eventAggregator  = eventAggregator;
            _toolbarService   = shellToolbarService as DefaultToolbar;
            _statusbarService = statusbarService;
            _commandManager   = commandManager;
            _menuService      = menuService;

            _menuService.PropertyChanged += _menus_PropertyChanged;

            _docs = new ObservableCollection <ContentViewModel>();
            _docs.CollectionChanged += Docs_CollectionChanged;
            _tools = new ObservableCollection <ToolViewModel>();

            IsValidationEnabled = false;
        }