示例#1
0
        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;
            }
        }
示例#2
0
        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;
        }