private async Task RenderDataView() { Message m = null; ButtonForm form = this.ButtonsForm; if (this.EnableSearch && this.SearchQuery != null && this.SearchQuery != "") { form = form.FilterDuplicate(this.SearchQuery, true); } else { form = form.Duplicate(); } if (this.Tags != null && this.SelectedTags != null) { form = form.TagDuplicate(this.SelectedTags); } if (this.EnablePaging) { form = GeneratePagingView(form); } if (this.HeadLayoutButtonRow != null && HeadLayoutButtonRow.Count > 0) { form.InsertButtonRow(0, this.HeadLayoutButtonRow); } if (this.SubHeadLayoutButtonRow != null && SubHeadLayoutButtonRow.Count > 0) { if (this.IsNavigationBarVisible) { form.InsertButtonRow(2, this.SubHeadLayoutButtonRow); } else { form.InsertButtonRow(1, this.SubHeadLayoutButtonRow); } } switch (this.KeyboardType) { //Reply Keyboard could only be updated with a new keyboard. case eKeyboardType.ReplyKeyboard: if (this.MessageId != null) { if (form.Count == 0) { await this.Device.HideReplyKeyboard(); this.MessageId = null; return; } if (this.DeletePreviousMessage) { await this.Device.DeleteMessage(this.MessageId.Value); } } if (form.Count == 0) { return; } var rkm = (ReplyKeyboardMarkup)form; rkm.ResizeKeyboard = this.ResizeKeyboard; rkm.OneTimeKeyboard = this.OneTimeKeyboard; m = await this.Device.Send(this.Title, rkm, disableNotification : true, parseMode : MessageParseMode, MarkdownV2AutoEscape : false); break; case eKeyboardType.InlineKeyBoard: //Try to edit message if message id is available //When the returned message is null then the message has been already deleted, resend it if (this.MessageId != null) { m = await this.Device.Edit(this.MessageId.Value, this.Title, (InlineKeyboardMarkup)form); if (m != null) { this.MessageId = m.MessageId; return; } } //When no message id is available or it has been deleted due the use of AutoCleanForm re-render automatically m = await this.Device.Send(this.Title, (InlineKeyboardMarkup)form, disableNotification : true, parseMode : MessageParseMode, MarkdownV2AutoEscape : false); break; } if (m != null) { this.MessageId = m.MessageId; } }