using System; using System.Linq; using System.Windows.Controls; using GalaSoft.MvvmLight.CommandWpf; using HandyControl.Controls; using HandyControlDemo.Data; using HandyControlDemo.Service; namespace HandyControlDemo.ViewModel { public class StepBarDemoViewModel : DemoViewModelBase { public StepBarDemoViewModel(DataService dataService) => DataList = dataService.GetStepBarDemoDataList(); /// /// 下一步 /// public RelayCommand NextCmd => new Lazy>(() => new RelayCommand(Next)).Value; /// /// 上一步 /// public RelayCommand PrevCmd => new Lazy>(() => new RelayCommand(Prev)).Value; private void Next(Panel panel) { foreach (var stepBar in panel.Children.OfType()) { stepBar.Next(); } } private void Prev(Panel panel) { foreach (var stepBar in panel.Children.OfType()) { stepBar.Prev(); } } } }