예제 #1
0
        public CurrencyVM()
        {
            Title      = "Валюта";
            Currencies = new ObservableCollection <Currency>();

            LoadItemsCommand = new Command(async() => await ExecuteLoadItemsCommand());

            MessagingCenter.Subscribe <NewCurrencyPage, Currency>(this, "AddCurrency", async(obj, item) =>
            {
                var newItem = item as Currency;
                Currencies.Add(newItem);
                await repository.AddItemAsync(newItem);
            });
        }