Exemplo n.º 1
0
        private void OnAddClick(object sender, RoutedEventArgs e)
        {
            var recipe = new Recipe
            {
                Id = Guid.NewGuid()
            };
            var window = new RecipeWindow(recipe, _project)
            {
                Owner = this
            };

            if (window.ShowDialog() == true)
            {
                _project.Add(recipe);
                _recipes.Add(recipe);
            }
        }
Exemplo n.º 2
0
        private void OnEditClick(object sender, RoutedEventArgs e)
        {
            var recipe = SelectedItems.FirstOrDefault();

            if (recipe == null)
            {
                return;
            }

            var window = new RecipeWindow(recipe, _project)
            {
                Owner = this
            };

            if (window.ShowDialog() == true)
            {
                Tune();
            }
        }