1 using Tizen.NUI.BaseComponents;
2 using Tizen.NUI.Components;
3 using static Tizen.NUI.Window;
5 namespace Tizen.NUI.Samples
7 public class WindowBorderSample : IExample
10 private Navigator navigator;
11 private ContentPage firstPage, secondPage;
12 private Button firstButton, secondButton;
13 private Button textButton;
14 private Button textButton1;
15 private void Popped(object sender, PoppedEventArgs args)
17 global::System.Console.WriteLine("Page is popped!");
20 if (args.Page == firstPage)
29 navigator.Popped -= Popped;
32 public void Activate()
34 Window window = NUIApplication.GetDefaultWindow();
36 navigator = new Navigator()
38 WidthResizePolicy = ResizePolicyType.FillToParent,
39 HeightResizePolicy = ResizePolicyType.FillToParent
42 window.Add(navigator);
46 textButton = new Button();
47 textButton.BackgroundImage = CommonResource.GetTVResourcePath() + "component/c_buttonbasic/c_basic_button_white_bg_normal_9patch.png";
48 textButton.BackgroundImageBorder = new Rectangle(4, 4, 5, 5);
49 textButton.Size = new Size(100, 80);
50 textButton.TextLabel.Text = "Left";
52 textButton.PositionUsesPivotPoint = true;
53 textButton.ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft;
54 textButton.PivotPoint = Tizen.NUI.ParentOrigin.BottomLeft;
55 window.Add(textButton);
57 textButton.Clicked += (object sender, ClickedEventArgs e) =>
59 Window.Instance.RequestResizeToServer(ResizeDirection.BottomLeft);
62 textButton1 = new Button();
63 textButton1.BackgroundImage = CommonResource.GetTVResourcePath() + "component/c_buttonbasic/c_basic_button_white_bg_normal_9patch.png";
64 textButton1.BackgroundImageBorder = new Rectangle(4, 4, 5, 5);
65 textButton1.Size = new Size(100, 80);
66 textButton1.TextLabel.Text = "Right";
68 textButton1.PositionUsesPivotPoint = true;
69 textButton1.ParentOrigin = Tizen.NUI.ParentOrigin.BottomRight;
70 textButton1.PivotPoint = Tizen.NUI.ParentOrigin.BottomRight;
71 window.Add(textButton1);
73 textButton1.Clicked += (object sender, ClickedEventArgs e) =>
75 Window.Instance.RequestResizeToServer(ResizeDirection.BottomRight);
79 private void CreateFirstPage()
81 firstButton = new Button()
84 WidthResizePolicy = ResizePolicyType.FillToParent,
85 HeightResizePolicy = ResizePolicyType.FillToParent,
87 firstButton.Clicked += (object sender, ClickedEventArgs e) =>
94 WidthResizePolicy = ResizePolicyType.FillToParent,
95 HeightResizePolicy = ResizePolicyType.FillToParent,
96 Layout = new LinearLayout()
98 VerticalAlignment = VerticalAlignment.Top,
99 LinearOrientation = LinearLayout.Orientation.Vertical,
100 CellPadding = new Size(50, 50),
104 parent1.Add(firstButton);
105 firstPage = new ContentPage()
107 AppBar = new AppBar()
109 AutoNavigationContent = false,
114 firstPage.Appearing += (object sender, PageAppearingEventArgs e) =>
116 global::System.Console.WriteLine("First Page is appearing!");
118 firstPage.Disappearing += (object sender, PageDisappearingEventArgs e) =>
120 global::System.Console.WriteLine("First Page is disappearing!");
123 navigator.Push(firstPage);
126 private void CreateSecondPage()
128 secondButton = new Button()
130 Text = "Second Page",
131 WidthResizePolicy = ResizePolicyType.FillToParent,
132 HeightResizePolicy = ResizePolicyType.FillToParent,
134 secondButton.Clicked += (object sender, ClickedEventArgs e) =>
139 secondPage = new ContentPage()
141 AppBar = new AppBar()
143 Title = "SecondPage",
145 Content = secondButton,
147 secondPage.Appearing += (object sender, PageAppearingEventArgs e) =>
149 global::System.Console.WriteLine("Second Page is appearing!");
151 secondPage.Disappearing += (object sender, PageDisappearingEventArgs e) =>
153 global::System.Console.WriteLine("Second Page is disappearing!");
156 navigator.Push(secondPage);
159 public void Deactivate()
161 if (navigator != null)
163 NUIApplication.GetDefaultWindow().Remove(navigator);