private async void ScannerOnDisappearing(object sender, EventArgs e)
        {
            const string genericErrorMessage =
                "Sorry, an error occurred when adding the book to your library. Try again later.";
            var scanner = sender as Scanner;
            var result  = scanner?.ScanResult;

            // try disconnecting the event handler
            if (scanner != null)
            {
                scanner.Disappearing -= ScannerOnDisappearing;
            }

            if (string.IsNullOrEmpty(result))
            {
                return;
            }

            try
            {
                // notify the user
                ToastService.Info($"Scanned ISBN: {result}. Adding to your library.");

                // call the service
                await _bookService.AddByIsbn(result);

                ToastService.Success("Book successfully added to your library");

                // refresh the library
                await pageHome.LoadData();

                await pageLibrary.LoadData();
            }
            catch (ApiException ex) when(ex.IsValidationException())
            {
                var error = await ex.GetContentAsAsync <ValidationErrorViewModel>();

                ToastService.Error(error?.Message?.Length > 0 ? error.Message[0] : genericErrorMessage);
            }
            catch (ApiException ex)
            {
                var error = await ex.GetContentAsAsync <ErrorViewModel>();

                ToastService.Error(error?.Message?.Length > 0 ? error.Message : genericErrorMessage);
            }
        }