コード例 #1
0
		public SlideDayIntervalPartViewModel(SlideDayIntervalViewModel slideDayIntervalViewModel, NamedSKDTimeInterval timeInterval)
		{
			SlideDayIntervalViewModel = slideDayIntervalViewModel;
			TimeInterval = timeInterval;

			AvailableTimeIntervals = new ObservableCollection<NamedSKDTimeInterval>();
			foreach (var namedTimeInterval in SKDManager.SKDConfiguration.NamedTimeIntervals)
			{
				AvailableTimeIntervals.Add(namedTimeInterval);
			}
			SelectedTimeInterval = TimeInterval;
		}
コード例 #2
0
		public NamedTimeIntervalViewModel(NamedSKDTimeInterval namedTimeInterval)
		{
			NamedTimeInterval = namedTimeInterval;
			AddCommand = new RelayCommand(OnAdd, CanAdd);
			EditCommand = new RelayCommand(OnEdit, CanEdit);
			RemoveCommand = new RelayCommand(OnRemove, CanRemove);
			TimeIntervals = new ObservableCollection<TimeIntervalViewModel>();
			foreach (var timeInterval in namedTimeInterval.TimeIntervals)
			{
				var timeIntervalViewModel = new TimeIntervalViewModel(timeInterval);
				TimeIntervals.Add(timeIntervalViewModel);
			}
		}
コード例 #3
0
		public NamedTimeIntervalDetailsViewModel(NamedSKDTimeInterval namedTimeInterval = null)
		{
			if (namedTimeInterval == null)
			{
				Title = "Новый именованный интервал";
				namedTimeInterval = new NamedSKDTimeInterval()
				{
					Name = "Именованный интервал"
				};
			}
			else
			{
				Title = "Редактирование именованного интервала";
			}
			NamedTimeInterval = namedTimeInterval;
			Name = NamedTimeInterval.Name;
			Description = NamedTimeInterval.Description;
		}