コード例 #1
0
        private async void btnAddCategory_Click(object sender, RoutedEventArgs e)
        {
            CategoryContentDialog dialog = new CategoryContentDialog();
            await dialog.ShowAsync();

            if (dialog.Return == CategoryContentDialogReturn.CategoryAdd)
            {
                _categoreisModel.AddCategory(dialog.CategoryCaption);
                lstCategoriesView.ItemsSource = _categoreisModel.LoadCategories();
            }
        }
コード例 #2
0
        private async void fltEditCategory_Click(object sender, RoutedEventArgs e)
        {
            MenuFlyoutItem fi = sender as MenuFlyoutItem;
            Category category = fi.DataContext as Category;

            CategoryContentDialog dialog = new CategoryContentDialog(category);
            await dialog.ShowAsync();

            if (dialog.Return == CategoryContentDialogReturn.CategoryEdit)
            {
                _categoreisModel.EditCategory(dialog.Category);
                lstCategoriesView.ItemsSource = _categoreisModel.LoadCategories();
            }
        }