1 using Tizen.NUI.BaseComponents;
2 using Tizen.NUI.Components;
4 namespace Tizen.NUI.Samples
6 public class DialogSample : IExample
8 private int oldPageCount = 0;
10 public void Activate()
12 var window = NUIApplication.GetDefaultWindow();
14 oldPageCount = window.GetDefaultNavigator().NavigationPages.Count;
16 var button = new Button()
18 Text = "Click to show Dialog",
19 WidthResizePolicy = ResizePolicyType.FillToParent,
20 HeightResizePolicy = ResizePolicyType.FillToParent
23 button.Clicked += (object sender, ClickedEventArgs e) =>
25 var textLabel = new TextLabel("Message")
27 BackgroundColor = Color.White,
28 Size = new Size(180, 180),
29 HorizontalAlignment = HorizontalAlignment.Center,
30 VerticalAlignment = VerticalAlignment.Center
33 Navigator.ShowDialog(textLabel);
36 window.GetDefaultNavigator().Push(new Page(button));
39 public void Deactivate()
41 var window = NUIApplication.GetDefaultWindow();
42 var newPageCount = window.GetDefaultNavigator().NavigationPages.Count;
44 for (int i = 0; i < (newPageCount - oldPageCount); i++)
46 window.GetDefaultNavigator().Pop();