コード例 #1
0
        private void ShowCriteriaDetailsButton_Click(object sender, RoutedEventArgs e)
        {
            // Get which contest is associated with this grid.
            if (CriteriasListView.SelectedItems.Count == 1)
            {
                Criteria criteria = (Criteria)CriteriasListView.SelectedItems[0];


                EditCriteriaContentDialog editCriteriaContentDialog = new EditCriteriaContentDialog(criteria);

                // Create callback to be called when ContentDialog closes.
                Action <ContentDialogResult> callback = async(result) =>
                {
                    await RefreshCriterias();
                };

                App.ShowContentDialog(editCriteriaContentDialog, callback);
            }
            else
            {
                ContentDialog errorMsg = new ContentDialog
                {
                    Title           = "Error",
                    Content         = "You must select a criteria to view it's details!",
                    CloseButtonText = "OK"
                };

                App.ShowContentDialog(errorMsg, null);
            }
        }
コード例 #2
0
        private void AddCriteriaButton_Click(object sender, RoutedEventArgs e)
        {
            EditCriteriaContentDialog editCriteriaContentDialog = new EditCriteriaContentDialog(null);

            // Create callback to be called when ContentDialog closes.
            Action <ContentDialogResult> callback = async(result) =>
            {
                await RefreshCriterias();
            };

            App.ShowContentDialog(editCriteriaContentDialog, callback);
        }
コード例 #3
0
        private void CriteriaGrid_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
        {
            // Get which contest is associated with this grid.
            if (CriteriasListView.SelectedItems.Count == 1)
            {
                Criteria criteria = (Criteria)CriteriasListView.SelectedItems[0];


                EditCriteriaContentDialog editCriteriaContentDialog = new EditCriteriaContentDialog(criteria);

                // Create callback to be called when ContentDialog closes.
                Action <ContentDialogResult> callback = async(result) =>
                {
                    await RefreshCriterias();
                };

                App.ShowContentDialog(editCriteriaContentDialog, callback);
            }
        }