FlorianDahn 8b9929198a 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
2020-04-04 19:52:15 +07:00

29 lines
690 B
C#

using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace TelegramBotBase.Form
{
public class ModalDialog : FormBase
{
/// <summary>
/// Contains the parent from where the modal dialog has been opened.
/// </summary>
public FormBase ParentForm { get; set; }
/// <summary>
/// This is a modal only function and does everything to close this form.
/// </summary>
public async Task CloseForm()
{
await this.CloseControls();
await this.OnClosed(new EventArgs());
this.ParentForm?.ReturnFromModal(this);
}
}
}