Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AddReceipe"/> class.
 /// </summary>
 public AddReceipe()
 {
     this.InitializeComponent();
     this.ingredientsNews  = new Dictionary <string, Ingredient>();
     this.navigationHelper = new NavigationHelper(this);
     this.newReceipe       = new NewReceipe();
     this.newReceipe.AddView(this);
     this.navigationHelper.LoadState += navigationHelper_LoadState;
     receipeName          = "";
     authorName           = "";
     mealTypeIndex        = 0;
     cookingTime          = "";
     difficultyLevelIndex = 0;
     costLevelIndex       = 0;
     toDoInstructions     = "";
     urlForImage          = "";
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Refreshes the page with the specific event given.
        /// </summary>
        /// <param name="e">The e.</param>
        public void Refresh(Event e)
        {
            if (e is ModifyIngredients)
            {
                ModifyIngredients srcEvnt   = (ModifyIngredients)e;
                NewReceipe        modelEvnt = (NewReceipe)srcEvnt.Model;
                this.ingredientsNews.Clear();
                this.ingredientsNews = null;
                this.ingredientsNews = new Dictionary <string, Ingredient>();

                foreach (Ingredient ing in modelEvnt.GetIngredientsAdded().Values)
                {
                    ingredientsNews.Add(ing.name, ing);
                }

                this.ingredientsViewSource.Source = ingredientsNews.Values;
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ModifyIngredients"/> class.
 /// </summary>
 /// <param name="model">The model.</param>
 public ModifyIngredients(NewReceipe model) : base(model)
 {
 }