internal IngredientReferenceViewModel(IngredientListViewModel ingredients, string ingredientID, Amount amount) { mIngredients = ingredients; mLookUp = new Dictionary <string, ValueDisplayItem>(); IngredientID = ingredientID; Amount = amount; RefreshLookUp(); Commit(); }
public SaveFileViewModel(ISaveFileService service) { ViewModelStack.Initialize(this); mService = service; var data = mService.ReadSaveFile(); Ingredients = new IngredientListViewModel(); foreach (var ingredient in data.Ingredients) { Ingredients.Items.Add(new IngredientViewModel(ingredient)); } Recipes = new RecipeListViewModel(Ingredients); foreach (var recipe in data.Recipes) { Recipes.Items.Add(new RecipeViewModel(Recipes, recipe)); } mSaveCommand = new DelegateCommand(DoSave); }
internal IngredientReferenceViewModel(IngredientListViewModel ingredients, IngredientReference reference) : this(ingredients, reference.IngredientID, reference.Amount) { }
internal RecipeListViewModel(IngredientListViewModel ingredientList) { mIngredientList = ingredientList; }