private async Task SaveItemFromExternal(UriSchemeMessage message, Action errorAction = null) { HomeButtonIsVisible = true; var allOk = true; ReaderItem item = null; try { IsSavingVisible = true; item = await _readerHelper.HandleProtocolMessage(message); } catch (Exception ex) { Log.ErrorException("ShareMessage", ex); allOk = false; } if (item != null) { await SetReaderItem(item, autostart : false); } IsSavingVisible = false; if (allOk && _canStart) { StartStopTimer(); } else { errorAction?.Invoke(); } }
protected override void WireMessages() { Messenger.Default.Register <UriSchemeMessage>(this, async m => { if (m.SchemeType != SchemeType.Edit) { return; } var text = _loader.GetString("Loading"); SetProgressBar(text); ReaderItem = await _readerHelper.HandleProtocolMessage(m); SetProgressBar(); }); }
protected override void WireMessages() { Messenger.Default.Register <UriSchemeMessage>(this, async m => { if (m.SchemeType != SchemeType.Save) { return; } IsSaving = true; try { await _readerHelper.HandleProtocolMessage(m); } catch (Exception ex) { Log.ErrorException("Saving from Scheme", ex); } IsSaving = false; }); }