Exemple #1
0
 public void SetModel(Model model)
 {
     this.model          = model;
     Items               = model.GetItems();
     model.ItemsChanged += Model_ItemsChanged;
     CreateItem          = new Mvvm1125.MvvmCommand(
         () => { PageContainer.ChangePageTo(PageType.CreateItem); },
         () => true);
 }
Exemple #2
0
 public void SetModel(Model model)
 {
     this.model = model;
     Items      = model.GetItems();
     CreateItem = new Mvvm1125.MvvmCommand(
         () => {
         if (model.TryJoin(FirstItem, SecondItem))
         {
             PageContainer.ChangePageTo(PageType.ListItems);
         }
     },
         () => FirstItem != null && SecondItem != null);
     BaseItems = new List <BaseItem>();
     BaseItems.Add(new BaseItem {
         Name           = "Корень имбиря",
         CreateBaseItem = new Mvvm1125.MvvmCommand(
             () => { model.AddItem(new Item {
                 Name = "Корень имбиря"
             }); },
             () => true)
     });
     BaseItems.Add(new BaseItem
     {
         Name           = "Шкура с жопы дракона",
         CreateBaseItem = new Mvvm1125.MvvmCommand(
             () => { model.AddItem(new Item {
                 Name = "Шкура с жопы дракона"
             }); },
             () => true)
     });
     model.ItemsChanged += Model_ItemsChanged;
     OpenRecipes         = new Mvvm1125.MvvmCommand(
         () => {
         PageContainer.ChangePageTo(PageType.EditRecipes);
     },
         () => true);
 }