예제 #1
0
        protected override void OnDeactivated(EventArgs e)
        {
            // save the current recipe before shutting down
            RecipesView      recipesView      = (RecipesView)MainWindow.FindName("RecipesView");
            RecipesViewModel recipesViewModel = (RecipesViewModel)recipesView.DataContext;

            recipesViewModel.SaveCurrentRecipe();

            // save the current batch before shutting down
            BatchesView      batchesView      = (BatchesView)MainWindow.FindName("BatchesView");
            BatchesViewModel batchesViewModel = (BatchesViewModel)batchesView.DataContext;

            batchesViewModel.SaveCurrentBatch();

            base.OnDeactivated(e);
        }
예제 #2
0
        private void UserControl_GotFocus(object sender, System.Windows.RoutedEventArgs e)
        {
            RecipesViewModel viewModel = (RecipesViewModel)DataContext;

            viewModel.GetSettings();
        }
예제 #3
0
        private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            RecipesViewModel viewModel = (RecipesViewModel)DataContext;

            viewModel.CurrentRecipe.UpdateRecipeOutcome();
        }