public Task SaveEntryAsync(DiaryEntry entry)
 {
     if (entry.Id == -1)
     {
         return(connection.InsertAsync(entry));
     }
     else
     {
         return(connection.InsertOrReplaceAsync(entry));
     }
 }
        public EditorPage(Account account, DiaryEntry entry = null)
        {
            this.account = account;
            this.entry   = entry == null ? new DiaryEntry()
            {
                AccountName = account == null ? "" : account.Username
            } : entry;

            InitializeComponent();

            if (this.entry.CipherText != null)
            {
                editorEntry.Text = GetDiaryText(this.entry.CipherText);
            }

            btnSave.Clicked   += BtnSaveClicked;
            btnCancel.Clicked += BtnCancelClicked;
        }
 public Task DeleteEntryAsync(DiaryEntry entry)
 {
     return(connection.DeleteAsync(entry));
 }