Event button in action list

I created an action table in actions in Xamarin formats with the following code,

DisplayActionSheet ("ActionSheet: Send to?", "Cancel", null, "Email", "Twitter", "Facebook");

Can I set event buttons for email, twitter, facebook?

+5
source share
1 answer

DisplayAction returns a Task <string> so as not to block the main thread. To handle the selection, you should use it in a way like this:

var action = await DisplayActionSheet ("ActionSheet: Send to?", "Cancel", null, "Email", "Twitter", "Facebook"); switch (action){ case "Email": DoSomething(); break; case "Twitter": DoSomethingElse(); break; ... } 
+11
source

Source: https://habr.com/ru/post/1208566/


All Articles