Exemplo n.º 1
0
        public MenuViewModel(IRegionManager regionManager, ISkinningService skinningService, IEventAggregator eventAggregator)
        {
            State            = (State)regionManager.Regions["MenuRegion"].Context;
            _skinningService = skinningService;
            _eventAggregator = eventAggregator;

            ExitApplicationCommand = new DelegateCommand <object>(ExitApplication, CanExitApplication);
            SetSkinCommand         = new DelegateCommand <string>(SetSkin, CanSetSkin);
            DuplicateTabCommand    = new DelegateCommand <object>(DuplicateTab, CanDuplicateTab);
            CloseOtherTabsCommand  = new DelegateCommand <object>(CloseOtherTabs, CanCloseOtherTabs);
            CloseAllTabsCommand    = new DelegateCommand <object>(CloseAllTabs, CanCloseAllTabs);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Shell"/> class.
        /// </summary>
        /// <param name="skinningService">The skinning service.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        public Shell(ISkinningService skinningService, IEventAggregator eventAggregator)
        {
            InitializeComponent();
            var state = new State();

            DataContext = state;
            _tabs       = new Dictionary <Guid, RadPane>();

            skinningService.SetSkin(state.SkinName);

            eventAggregator.GetEvent <AddTabEvent>().Subscribe(AddTab);
            eventAggregator.GetEvent <CloseOtherTabsEvent>().Subscribe(CloseOtherTabs);
            eventAggregator.GetEvent <CloseAllTabsEvent>().Subscribe(CloseAllTabs);
        }