コード例 #1
0
ファイル: SchedulesBox.xaml.cs プロジェクト: kib357/Ester2
 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>();
 }
コード例 #2
0
ファイル: SchedulesViewModel.cs プロジェクト: kib357/Ester2
		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;
		}