Пример #1
0
        /// <summary>
        /// Notifies the module that it has be initialized.
        /// </summary>
        public void Initialize()
        {
            RegisterViewsAndServices();

            IToolBarPresentationModel model = _container.Resolve <IToolBarPresentationModel>();

            IRegion toolbarRegion = _regionManager.Regions["ToolBarRegion"];

            toolbarRegion.Add(model.View);
            toolbarRegion.Activate(model.View);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="MusicSearchPresenterModel" /> class.
        /// </summary>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="toolbarPresentationModel">The toolbar presentation model.</param>
        public MusicSearchPresenterModel(
            IEventAggregator eventAggregator,
            IToolBarPresentationModel toolbarPresentationModel)
        {
            _eventAggregator          = eventAggregator;
            _toolbarPresentationModel = toolbarPresentationModel;

            _searchForArtistCommand         = new DelegateCommand <object>(SearchForArtistCommandExecuted);
            _searchForArtistReleasesCommand = new DelegateCommand <object>(SearchForArtistReleasesCommandExecuted, SearchForArtistReleasesCommandCanExecute);
            _clearArtistInfoCommand         = new DelegateCommand <object>(ClearArtistInfoCommandExecuted, ClearArtistInfoCommandCanExecute);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="MusicSearchPresenterModel" /> class.
        /// </summary>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="toolbarPresentationModel">The toolbar presentation model.</param>
        public MusicSearchPresenterModel(
            IEventAggregator eventAggregator,
            IToolBarPresentationModel toolbarPresentationModel)
        {
            _eventAggregator = eventAggregator;
            _toolbarPresentationModel = toolbarPresentationModel;

            _searchForArtistCommand = new DelegateCommand<object>(SearchForArtistCommandExecuted);
            _searchForArtistReleasesCommand = new DelegateCommand<object>(SearchForArtistReleasesCommandExecuted, SearchForArtistReleasesCommandCanExecute);
            _clearArtistInfoCommand = new DelegateCommand<object>(ClearArtistInfoCommandExecuted, ClearArtistInfoCommandCanExecute);
        }