DialogPage
Overview
Tizen.NUI.Components.DialogPage class helps to show a dialog on the screen. DialogPage
is composed of Content and Scrim properties.
Content
property indicates the region to show the dialog on the screen. Tizen.NUI.Components.AlertDialog class or Tizen.NUI.Components.Dialog class is set to Content
property.
Scrim
property indicates the dimmed background region behind the dialog. By default, DialogPage
is popped when Scrim
is clicked.
To show a dialog easier, DialogPage
provides ShowAlertDialog and ShowDialog methods instead of pushing DialogPage
to Navigator
manually.
Example code
The following example shows how to create a DialogPage
:
C#
Copy
Button cancelButton = new Button()
{
Text = "Cancel",
};
cancelButton.Clicked += (o, e) =>
{
// Executes cancel actions.
// ...
// Pops DialogPage from Navigator.
NUIApplication.GetDefaultWindow().GetDefaultNavigator().Pop();
};
Button okButton = new Button()
{
Text = "OK",
};
okButton.Clicked += (o, e) =>
{
// Executes ok actions.
// ...
// Pops DialogPage from Navigator.
NUIApplication.GetDefaultWindow().GetDefaultNavigator().Pop();
};
DialogPage.ShowAlertDialog("Title",
"Message",
cancelButton, okButton);
// The above ShowAlertDialog does the same with the following code.
// DialogPage dialogPage = new DialogPage
// {
// Content = new AlertDialog()
// {
// Title = "Title",
// Message = "Message",
// Actions = new View[] { cancelButton, okButton },
// },
// };
// // Pushes the DialogPage to the default Navigator.
// NUIApplication.GetDefaultWindow().GetDefaultNavigator().Push(dialogPage);
You can scroll this table.
django
Copy
<?xml version="1.0" encoding="UTF-8"?>
<DialogPage x:Class="MyDialogPage"
xmlns="http://tizen.org/Tizen.NUI/2018/XAML"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
<DialogPage.Content>
<AlertDialog Title="Title" Message="Message">
<AlertDialog.ActionContent>
<View WidthSpecification="626">
<View.Layout>
<FlexLayout Direction="Row" Justification="SpaceBetween"/>
</View.Layout>
</View>
</AlertDialog.ActionContent>
</AlertDialog>
</DialogPage.Content>
</DialogPage>
<!-- Needs to push the DialogPage to the default Navigator in .cs file. -->
You can scroll this table.
Related information
- Dependencies
- Tizen 6.5 and Higher
Submit your feedback to GitHub