Modal and Form updates

- adding ReturnFromModal method to FormBase, will get invoked if context leaves a ModalDialog
- ModalDialog contains ParentForm for better navigation
- ModalDialog invokes ReturnFromModal on parentForm after closing
- adding ShowBackButton to PromptDialog for show a back button
This commit is contained in:
FlorianDahn
2020-04-04 19:52:15 +07:00
parent 7a3e4721bd
commit 8b9929198a
3 changed files with 38 additions and 2 deletions
+13
View File
@@ -107,6 +107,8 @@ namespace TelegramBotBase.Form
}
}
public async Task OnClosed(EventArgs e)
{
if (this.Events[__evClosed] == null)
@@ -136,6 +138,16 @@ namespace TelegramBotBase.Form
}
}
/// <summary>
/// Get invoked when a modal child from has been closed.
/// </summary>
/// <param name="message"></param>
/// <returns></returns>
public virtual async Task ReturnFromModal(ModalDialog modal)
{
}
/// <summary>
/// Pre to form close, cleanup all controls
@@ -337,6 +349,7 @@ namespace TelegramBotBase.Form
ds.ActiveForm = newForm;
newForm.Client = parentForm.Client;
newForm.Device = ds;
newForm.ParentForm = parentForm;
newForm.Closed += async (s, en) =>
{