Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

how to prevent closing of dialog when user touches outside of dialog area?

$
0
0

Dear xamarin dev team, I'm using Xamarin Forms in my project.
When I pops up AlertDialog or ActionSheet by calling

await ((Page)p).DisplayActionSheet (caption, null, cancel, opt1Text, opt2Text);
or
await ((Page)p).**DisplayAlert **(caption, msg, "yes", "no")

everything works fine and dialog pops up correctly.
BUT on android devices user can close the dialog by touching outside of dialog view. (this behavior was described earlier http://forums.xamarin.com/discussion/comment/70362/#Comment_70362).

I need to prevent this behavior somehow to force user to specify some value or press on cancel button directly.
When you develop native java android application you can forbid this behavior by calling setCanceledOnTouchOutside(false); for Dialog instance

Unfortunately, there is no property of Dialog instance when using Xamarin Forms page class. I tried to create Custom render of page to modify dialog property but I could not find any proper method responsible for dialogs displaying.

Is any suggestions you can provide to me to figure out this issue?

Best regards, Sergiy Subbotin


Viewing all articles
Browse latest Browse all 89864

Trending Articles