示例#1
0
        public CitiesViewModel()
        {
            Title  = "Cities";
            Cities = new ObservableCollection <City>();

            //CARREGA DOS ITEMS PARA A LISTA
            LoadItemsCommand = new Command(async() => await ExecuteLoadItemsCommand());

            MessagingCenter.Subscribe <SearchView, Item>(this, "AddItem", async(obj, item) =>
            {
                var _city = item as Item;
                //Cities.Add(_city);
                await DataStore.AddCityAsync(_city);
            });
        }