public NavigationViewModel(IFriendLookupDataService friendLookupService, IMeetingLookupDataService meetingLookupService, IEventAggregator eventAggregator)
        {
            _friendLookupService  = friendLookupService;
            _meetingLookupService = meetingLookupService;
            _eventAggregator      = eventAggregator;
            Friends  = new ObservableCollection <NavigationItemViewModel>();
            Meetings = new ObservableCollection <NavigationItemViewModel>();
            _eventAggregator
            .GetEvent <AfterDetailSavedEvent>()
            .Subscribe(
                obj =>
            {
                switch (obj.ViewModelName)
                {
                case nameof(FriendDetailViewModel):
                    AfterDetailSaved(Friends, obj);
                    break;

                case nameof(MeetingDetailViewModel):
                    AfterDetailSaved(Meetings, obj);
                    break;
                }
            });
            _eventAggregator.GetEvent <AfterDetailDeletedEvent>().Subscribe(AfterDetailDeleted);
        }
Esempio n. 2
0
 public NavigationViewModel(IFriendLookupDataService friendLookupDataService,
                            IMeetingLookupDataService meetingLookupDataService,
                            IEventAggregator eventAggregator)
 {
     _friendLookupDataService  = friendLookupDataService;
     _meetingLookupDataService = meetingLookupDataService;
     _eventAggregator          = eventAggregator;
     _eventAggregator.GetEvent <AfterDetailSavedEvent>().Subscribe(AfterDetailSaved);
     _eventAggregator.GetEvent <AfterDetailDeletedEvent>().Subscribe(AfterDetailDeleted);
 }
Esempio n. 3
0
 public NavigationViewModel(IFriendLookupDataService friendLookupDataService, IMeetingLookupDataService meetingLookupDataService, IEventAggregator eventAggregator)
 {
     _eventAggregator          = eventAggregator;
     _friendLookupDataService  = friendLookupDataService;
     _meetingLookupDataService = meetingLookupDataService;
     Friends  = new ObservableCollection <NavigationItemViewModel>();
     Meetings = new ObservableCollection <NavigationItemViewModel>();
     _eventAggregator.GetEvent <AfterDetailSavedEvent>().Subscribe(AfterDetailSaved);
     _eventAggregator.GetEvent <AfterDetailDeletedEvent>().Subscribe(AfterDetailDeleted);
 }
Esempio n. 4
0
 public NavigationViewModel(IPersonLookupDataService personLookupService,
                            IEventAggregator eventAggregator, IMeetingLookupDataService meetingLookupDataService)
 {
     _personLookupService      = personLookupService;
     _eventAggregator          = eventAggregator;
     _meetingLookupDataService = meetingLookupDataService;
     Persons  = new ObservableCollection <NavigationItemViewModel>();
     Meetings = new ObservableCollection <NavigationItemViewModel>();
     _eventAggregator.GetEvent <AfterDetailSavedEvent>().Subscribe(AfterDetailSaved);
     _eventAggregator.GetEvent <AfterDetailDeletedEvent>().Subscribe(AfterDetailDeleted);
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="ALookupDataService"></param>
        public NavigationViewModel(ILookupDataServiceFriend ALookupDataService
                                   , IMeetingLookupDataService meetingLookupDataService
                                   , IEventAggregator ea)
        {
            Friends  = new ObservableCollection <NavigationItemViewModel>();
            Meetings = new ObservableCollection <NavigationItemViewModel>();

            _lookupDataService        = ALookupDataService;
            _meetingLookupDataService = meetingLookupDataService;
            _eventAgregator           = ea;

            _eventAgregator.GetEvent <AfterDetailSaveEvent>().Subscribe(OnAfterDetailSaved);
            _eventAgregator.GetEvent <AfterDetailDeleteEvent>().Subscribe(OnAfterDetailDeleted);
        }