protected virtual void OnSelectedDemoModuleChanged(DemoModuleViewModel oldValue, DemoModuleViewModel newValue) { ObservableCollection <DemoModuleViewModel> demoModules = new ObservableCollection <DemoModuleViewModel>(); ActualDemoModules.Clear(); int demoModuleIndex = DemoModules.IndexOf(newValue); for (int i = 0; i < DemoModules.Count; i++) { ActualDemoModules.Add(DemoModules[demoModuleIndex]); demoModuleIndex = (demoModuleIndex + 1) % DemoModules.Count; } }
void UpdateFilteredDemoModules(DemoModuleViewModel firstDemoModule) { int index = DemoModules.IndexOf(firstDemoModule); FilteredDemoModules.Clear(); for (int i = index; i < DemoModules.Count; i++) { if (DemoModules[i].IsVisible) { FilteredDemoModules.Add(DemoModules[i]); } } for (int i = 0; i < index; i++) { if (DemoModules[i].IsVisible) { FilteredDemoModules.Add(DemoModules[i]); } } PrevNextEnabled = FilteredDemoModules.Count > 1; }