


The destroy button can be specified as the third string argument to the DisplayActionSheet method, or can be left null. The action sheet will be displayed modally:Īfter the user taps one of the buttons, the button label will be returned as a string.Īction sheets also support a destroy button, which is a button that represents destructive behavior. To display an action sheet, use the DisplayActionSheet method on any Page, passing the message and button labels as strings: string action = await DisplayActionSheet("ActionSheet: Send to?", "Cancel", null, "Email", "Twitter", "Facebook")
#Round table pazuru how to
Guide users through tasksĪn action sheet presents the user with a set of alternatives for how to proceed with a task. The DisplayAlert method also has overloads that accept a FlowDirection argument that specifies the direction in which UI elements flow within the alert. To get a response from an alert, supply text for both buttons and await the method: bool answer = await DisplayAlert("Question?", "Would you like to play a game", "Yes", "No") Īfter the user selects one of the options the response will be returned as a bool. The DisplayAlert method can also be used to capture a user's response by presenting two buttons and returning a bool. The alert is displayed modally, and once dismissed the user continues interacting with the app: The following example shows a simple message to the user: await DisplayAlert("Alert", "You have been alerted", "OK") To display alerts, use the DisplayAlert method on any Page. NET MAUI-supported platforms have a modal pop-up to alert the user or ask simple questions of them. Pop-ups are rendered with native controls on each platform. Displaying an alert, asking a user to make a choice, or displaying a prompt is a common UI task.NET Multi-platform App UI (.NET MAUI) has three methods on the Page class for interacting with the user via a pop-up: DisplayAlert, DisplayActionSheet, and DisplayPromptAsync.
