2 * Copyright(c) 2021 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using Tizen.NUI.BaseComponents;
19 using Tizen.NUI.Components;
21 namespace NUITizenGallery
23 public partial class AlertDialogTestPage : ContentPage
25 public AlertDialogTestPage()
27 InitializeComponent();
29 buttonOneAction.Clicked += ButtonOneActionClicked;
30 buttonTwoActions.Clicked += ButtonTwoActionsClicked;
31 buttonNoTitle.Clicked += ButtonNoTitleClicked;
32 buttonNoMessage.Clicked += ButtonNoMessageClicked;
33 buttonTwoAlertDialog.Clicked += ButtonTwoAlertDialogClicked;
34 buttonNewAlertDialog.Clicked += ButtonNewAlertDialogClicked;
40 private void ButtonOneActionClicked(object sender, ClickedEventArgs args)
42 var button = new Button()
47 button.Clicked += (object s, ClickedEventArgs a) =>
52 DialogPage.ShowAlertDialog("Title", "Message", button);
55 private void ButtonTwoActionsClicked(object sender, ClickedEventArgs args)
57 var button = new Button()
62 button.Clicked += (object s, ClickedEventArgs a) =>
67 var button2 = new Button()
72 button2.Clicked += (object s, ClickedEventArgs a) =>
77 DialogPage.ShowAlertDialog("Title", "Message", button, button2);
80 private void ButtonNoTitleClicked(object sender, ClickedEventArgs args)
82 var button = new Button()
87 button.Clicked += (object s, ClickedEventArgs a) =>
92 var button2 = new Button()
97 button2.Clicked += (object s, ClickedEventArgs a) =>
102 DialogPage.ShowAlertDialog(null, "Message", button, button2);
105 private void ButtonNoMessageClicked(object sender, ClickedEventArgs args)
107 var button = new Button()
112 button.Clicked += (object s, ClickedEventArgs a) =>
117 var button2 = new Button()
122 button2.Clicked += (object s, ClickedEventArgs a) =>
127 DialogPage.ShowAlertDialog("Title", null, button, button2);
130 private void ButtonTwoAlertDialogClicked(object sender, ClickedEventArgs args)
132 var button = new Button()
137 button.Clicked += (object s, ClickedEventArgs a) =>
142 DialogPage.ShowAlertDialog("Title", "Message", button);
144 var button2 = new Button()
149 button2.Clicked += (object s, ClickedEventArgs a) =>
154 DialogPage.ShowAlertDialog("Title2", "Message2", button2);
157 private void ButtonNewAlertDialogClicked(object sender, ClickedEventArgs args)
159 var button = new Button()
164 button.Clicked += (object s, ClickedEventArgs a) =>
169 var button2 = new Button()
171 Text = $"New AlertDialog {++count}",
174 button2.Clicked += (object s, ClickedEventArgs a) =>
176 ButtonNewAlertDialogClicked(s, a);
179 DialogPage.ShowAlertDialog("Title", "Message", button, button2);