public SchedulesBox() { InitializeComponent(); if (DesignerProperties.GetIsInDesignMode(this)) return; EventAggregator = ServiceLocator.Current.GetInstance<IEventAggregator>(); EventAggregator.GetEvent<ApplicationLoadedEvent>().Subscribe(OnSchedulesLoaded); _schedulesRepository = ServiceLocator.Current.GetInstance<IUnityContainer>().Resolve<SchedulesRepository>(); }
public SchedulesViewModel(IEventAggregator eventAggregator, IDataTransport dataTransport, IUnityContainer container) { Schedules = new ObservableCollection<ScheduleClass>(); _eventAggregator = eventAggregator; _dataTransport = dataTransport; _scheduleRepository = container.Resolve<SchedulesRepository>(); AddScheduleCommand = new DelegateCommand<string>(AddSchedule); SaveScheduleCommand = new DelegateCommand(SaveSchedule); DropScheduleCommand = new DelegateCommand(DropSchedule); CancelCommand = new DelegateCommand(Cancel); _selectedScheduleType = ScheduleTypes.Light; }