예제 #1
0
        private async void addStep(object sender, RoutedEventArgs e)
        {
            StepDialog stepDialog = new StepDialog();
            await stepDialog.ShowAsync();

            RecipeStep newRecipeStep = stepDialog.TargetRecipeStep;

            if (newRecipeStep != null)
            {
                this.steps.Add(newRecipeStep);
            }
        }
예제 #2
0
        private async void editStep(object sender, RoutedEventArgs e)
        {
            RecipeStep stepToEdit = (RecipeStep)((MenuFlyoutItem)e.OriginalSource).DataContext;
            int        stepIndex  = steps.IndexOf(stepToEdit);
            StepDialog stepDialog = new StepDialog(stepToEdit);
            await stepDialog.ShowAsync();

            RecipeStep updatedStep = stepDialog.TargetRecipeStep;

            if (updatedStep != null)
            {
                this.steps[stepIndex] = updatedStep;
            }
        }