private void ShowCategoryDetailsButton_Click(object sender, RoutedEventArgs e) { // Get which contest is associated with this grid. if (CategoriesListView.SelectedItems.Count == 1) { Category category = (Category)CategoriesListView.SelectedItems[0]; EditCategoryContentDialog editCategoryContentDialog = new EditCategoryContentDialog(category); // Create callback to be called when ContentDialog closes. Action <ContentDialogResult> callback = async(result) => { await RefreshCategories(); }; App.ShowContentDialog(editCategoryContentDialog, callback); } else { ContentDialog errorMsg = new ContentDialog { Title = "Error", Content = "You must select a category to view it's details!", CloseButtonText = "OK" }; App.ShowContentDialog(errorMsg, null); } }
private void AddCategoryButton_Click(object sender, RoutedEventArgs e) { EditCategoryContentDialog editCategoryContentDialog = new EditCategoryContentDialog(null); // Create callback to be called when ContentDialog closes. Action <ContentDialogResult> callback = async(result) => { await RefreshCategories(); }; App.ShowContentDialog(editCategoryContentDialog, callback); }
private void CategoryGrid_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e) { // Get which contest is associated with this grid. if (CategoriesListView.SelectedItems.Count == 1) { Category category = (Category)CategoriesListView.SelectedItems[0]; EditCategoryContentDialog editCategoryContentDialog = new EditCategoryContentDialog(category); // Create callback to be called when ContentDialog closes. Action <ContentDialogResult> callback = async(result) => { await RefreshCategories(); }; App.ShowContentDialog(editCategoryContentDialog, callback); } }