private async void OnSave()
        {
            var newBook = new Book()
            {
                Id = Guid.NewGuid(),
            };

            await BooksDataStore.AddBookAsync(newBook);

            // This will pop the current page off the navigation stack
            await Shell.Current.GoToAsync("..");
        }
Beispiel #2
0
        async Task ExecuteLoadBooksCommand()
        {
            IsBusy = true;

            try
            {
                Book.Clear();
                var _books = await BooksDataStore.GetItemsAsync(true);

                foreach (var book in _books)
                {
                    Book.Add(book);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }