Ejemplo n.º 1
0
        private void EditSelectedCategory()
        {
            if (CategoryListBox.SelectedItem == null)
            {
                return;
            }

            var category = (Category)CategoryListBox.SelectedItem;

            var categoryWindow = new CategoryWindow();

            categoryWindow.Display(category, Window.GetWindow(this));
        }
Ejemplo n.º 2
0
        private void AddCategory()
        {
            var category = Category.Create();

            var categoryWindow = new CategoryWindow();

            var result = categoryWindow.Display(category, Window.GetWindow(this));

            if (result.HasValue && result.Value)
            {
                Database.Categories.Add(category);

                CategoryListBox.SelectedItem = category;

                SetCategoryButtonStates();
            }
        }