Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        private void UserControl_GotFocus(object sender, System.Windows.RoutedEventArgs e)
        {
            RecipesViewModel viewModel = (RecipesViewModel)DataContext;

            viewModel.GetSettings();
        }
Ejemplo n.º 3
0
        private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            RecipesViewModel viewModel = (RecipesViewModel)DataContext;

            viewModel.CurrentRecipe.UpdateRecipeOutcome();
        }