public ExpensesPage() { Title = "Despesas"; Items = new ObservableRangeCollection <Expense>(); LoadItemsCommand = new Command(async() => await ExecuteLoadItemsCommand()); RefreshCommand = new Command(Load); _service = new ExpensesAzureRest(); MessagingCenter.Subscribe <NewExpansePage, Expense>(this, "AddExpense", async(obj, item) => { Items.Add(item); await DataStore.AddItemAsync(item); }); }
public ExpenseVm() { NewExpenseCommand = new Command(AddExpense); _service = new ExpensesAzureRest(); }