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

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