public CategorySettingViewModel(IList <UIHistoryEntity> items) { this.Items = items; SaveCommand = new DelegateCommand <object>(OnSave, CanExcute); CancelCommand = new DelegateCommand <object>(OnCancel, CanExcute); AddNewCategoryCommand = new DelegateCommand <object>(OnAddNewCategory, CanExcute); RemoveNewCategoryCommand = new DelegateCommand <object>(OnRemoveNewCategory, CanExcute); foreach (CategoryEntity category in DataManager.Instance.Categories) { ExistCategories.Add(UICategoryEntity.CreateFrom(category)); } }
private void ComposeData() { Root.Children.Clear(); foreach (CategoryEntity item in DataManager.Instance.Categories) { UICategoryEntity uiItem = UICategoryEntity.CreateFrom(item); if (uiItem.IsNull()) { continue; } Root.Children.Add(uiItem); } Root.IsSelected = true; //Root.Children = CollectionViewSource.GetDefaultView(source); //Root.Children.Refresh(); }