Example #1
0
        /// <summary>
        /// The constructor for the ClassesView. Wires up all the necessary
        /// objects and events needed by this View.
        /// </summary>
        /// <param name="presenter"></param>
        /// <param name="eventAggregator"></param>
        /// <param name="configurationService"></param>
        public PersonsView(PersonsPresenter presenter, IEventAggregator eventAggregator,
                           IConfigurationService configurationService) : this()
        {
            _presenter            = presenter;
            _presenter.View       = this;
            _eventAggregator      = eventAggregator;
            _configurationService = configurationService;

            logger.Debug("Subscribing to ShellRefreshRequestedEvent.");

            ShellRefreshRequestedEvent shellRefreshRequestedEvent = _eventAggregator.GetEvent <ShellRefreshRequestedEvent>();

            shellRefreshRequestedEvent.Subscribe(OnShellRefreshRequested, ThreadOption.UIThread);

            // Hook into the CanExecuteEvent of the DataGrid so that we can look for
            // when user tries to Delete
            PeopleDataGrid.AddHandler(CommandManager.CanExecuteEvent,
                                      new CanExecuteRoutedEventHandler(OnCanExecuteRoutedEventHandler), true);

            // Hook into the CanExecuteEvent of the DataGrid so that we can look for
            // when user tries to Delete
            FamilyDataGrid.AddHandler(CommandManager.CanExecuteEvent,
                                      new CanExecuteRoutedEventHandler(OnCanExecuteRoutedEventHandler), true);
        }