Ejemplo n.º 1
0
        public ItemsViewModel()
        {
            Title            = "Browse";
            Items            = new ObservableCollection <Item>();
            LoadItemsCommand = new Command(async() => await ExecuteLoadItemsCommand());

            MessagingCenter.Subscribe <NewItemPage, Item>(this, "AddItem", async(obj, item) =>
            {
                var newItem = item as Item;
                Items.Add(newItem);
                await ItemStore.AddDataAsync(newItem);
            });
        }