[c#]
popupLayout.Closing += PopupLayout_Closing;
…
private void PopupLayout_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
var delay = System.DateTime.Now.AddMilliseconds(2000);
while (true)
{
if (System.DateTime.Now >= delay)
{
e.Cancel = false;
break;
}
}
}
|
Hi Tamas,Thank you for contacting Syncfusion support.Based on the provided information, we have checked your requirement of waiting asynchronously when closing the Popup layout by clicking accept / close option in Xamarin.Forms can be achievable by setting delay in the Closing event of PopupLayout. This event will while closing the Popup layout, using Cancel argument you can handle whether to close Popup or not. Please refer the following code example for the same,
[c#]popupLayout.Closing += PopupLayout_Closing;…private void PopupLayout_Closing(object sender, System.ComponentModel.CancelEventArgs e){var delay = System.DateTime.Now.AddMilliseconds(2000);while (true){if (System.DateTime.Now >= delay){e.Cancel = false;break;}}}We have prepared sample based on your requirement by setting delay while opening and closing the Popup, please find the sample by the following link.Please let us know, if this helpful.Regards,
Subburaj Pandian V
[C#]
popupLayout.Opened += PopupLayout_Opened;
private async void PopupLayout_Opened(object sender, EventArgs e)
{
// Codes that needs to be executed once popup is visible in the screen.
} |