Example #1
0
        public void AddCategory()
        {
            var dialog = new ActionCategoryInput();

            dialog.Closing += (sender, args) =>
            {
                if (dialog.DataContext is CategoryInputViewModel vm && vm.PocketCategory.Id > 0)
                {
                    PocketCategories.Add(vm.PocketCategory);
                    SelectedPocketCategory = vm.PocketCategory;
                }
            };

            dialog.ShowDialogWindow(new CategoryInputViewModel(dialog), mWindow);
        }
Example #2
0
 public void LoadPocketCategories()
 {
     using var db           = new AppDbContext();
     PocketCategories       = db.PocketCategories.ToObservableCollection();
     SelectedPocketCategory = PocketCategories.FirstOrDefault();
 }