internal ReduceRecipeViewModel(RecipeEditorViewModel recipe)
        {
            mRecipe = recipe;
            mItems  = new BindingList <ReduceRecipeItemViewModel>();
            foreach (var item in recipe.Items)
            {
                mItems.Add(new ReduceRecipeItemViewModel(item));
            }

            Commit();
        }
示例#2
0
        internal ModifyRecipeViewModel(RecipeEditorViewModel recipe)
        {
            mRecipe = recipe;
            Name    = recipe.Name + " (Modified)";

            ByIngredient        = true;
            SelectedIngredient  = null;
            NewIngredientAmount = 0;

            SelectedRecipeAmountDisplay = string.Format("Instead of {0}", Extensions.GetDisplay(recipe.Amount, recipe.Measurement));
            NewRecipeAmount             = 0;

            Commit();
        }