void OnRecipeChanged(Recipe recipe) { var viewmodel = (from vm in AllRecipes where vm.Id == recipe.Id select vm).FirstOrDefault(); if (viewmodel == null) { viewmodel = new SingleRecipeViewModel(recipe); AllRecipes.Add(viewmodel); } else { viewmodel.ExchangeData(recipe); } OnPropertyChanged("ItemSelected"); OnPropertyChanged("ItemsSelected"); }
public SingleRecipeViewModel(Recipe recipe) { _recipe = recipe; base.DisplayName = _recipe.Plu.ToString(); }
public EditRecipe(Recipe recipe) { Recipe = recipe; }
public void ExchangeData(Recipe recipe) { _recipe = recipe; }