public TransitionsViewModel(KynapseePaneModel submodel) { submodel_ = submodel; Gestures = submodel_.Presentation.GetNuiModel(); Methods = new List<TransitionMethod>() { TransitionMethod.NextSlide, TransitionMethod.PreviousSlide, TransitionMethod.TargetSlide }; sr_ = submodel_.SlideRange; set_ = sr_.GetTransitions(submodel_.Presentation, Gestures); Transitions = new ObservableCollection<TransitionItem>(set_.Transitions.Select((x) => new TransitionItem(this, x))); NewTransitionCommand = new RelayCommand(NewTransition); submodel_.PropertyChanged += KynapseePropertyChanged; }
void KynapseePropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { switch (e.PropertyName) { case "Presentation": if (submodel_.Presentation != null) Gestures = submodel_.Presentation.GetNuiModel(); break; case "SlideRange": sr_ = submodel_.SlideRange; set_ = sr_.GetTransitions(submodel_.Presentation, Gestures); Transitions = new ObservableCollection<TransitionItem>(set_.Transitions.Select((x) => new TransitionItem(this, x))); break; } }