Пример #1
0
        private void Button_OnClicked(object sender, EventArgs e)
        {
            //Create an item based on the contents of the controls
            var item = new GroceryListItem
            {
                Name     = ItemName.Text,
                Quantity = int.Parse(ItemQuantity.Text)
            };

            //Tell the world about this great achievement
            var @event = new ItemAdded {
                GroceryListItem = item
            };

            MessageBus.Publish(@event);

            //our work is done here, shuts down the current window
            this.Navigation.PopModalAsync(true);
        }
Пример #2
0
 public Task <int> Save(GroceryListItem groceryListItem)
 {
     return(Connection.InsertAsync(groceryListItem));
 }