示例#1
0
        public EmployeesViewModel()
        {
            Title            = "Browse";
            Items            = new ObservableCollection <Employee>();
            LoadItemsCommand = new Command(async() => await ExecuteLoadItemsCommand());

            MessagingCenter.Subscribe <NewItemPage, Employee>(this, "AddItem", async(obj, employee) =>
            {
                Items.Add(employee);
                await DataStore.AddEmployeeAsync(employee);
            });
        }