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; }
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); } }
public NamedTimeIntervalDetailsViewModel(NamedSKDTimeInterval namedTimeInterval = null) { if (namedTimeInterval == null) { Title = "Новый именованный интервал"; namedTimeInterval = new NamedSKDTimeInterval() { Name = "Именованный интервал" }; } else { Title = "Редактирование именованного интервала"; } NamedTimeInterval = namedTimeInterval; Name = NamedTimeInterval.Name; Description = NamedTimeInterval.Description; }