public MainPageViewModel() { _todoListRepository = new Repositories.TodoListRepository(); if (Windows.ApplicationModel.DesignMode.DesignModeEnabled) { // designtime sample data var data = _todoListRepository.Sample().Select(x => new ViewModels.TodoListViewModel(x)); this.TodoLists = new ObservableCollection <ViewModels.TodoListViewModel>(data); } else { // update commands this.PropertyChanged += (s, e) => { this.AddListCommand.RaiseCanExecuteChanged(); this.RemoveListCommand.RaiseCanExecuteChanged(); }; } }
public MainPageViewModel() { _todoListRepository = Repositories.TodoListRepository.GetDefault(); if (Windows.ApplicationModel.DesignMode.DesignModeEnabled) { // designtime sample data var data = _todoListRepository.Sample().Select(x => new ViewModels.TodoListViewModel(x)); this.TodoLists = new ObservableCollection<ViewModels.TodoListViewModel>(data); } else { // update commands this.PropertyChanged += (s, e) => { this.AddListCommand.RaiseCanExecuteChanged(); this.RemoveListCommand.RaiseCanExecuteChanged(); }; } }