1 using Tizen.NUI.BaseComponents;
2 using Tizen.NUI.Components;
4 namespace Tizen.NUI.Samples
6 public class AppBarSample : IExample
8 private Page firstPage, secondPage;
9 private AppBar firstAppBar, secondAppBar;
10 private Button firstActionButton, secondActionButton;
11 private Button firstButton, secondButton;
13 public void Activate()
18 private void CreateFirstPage()
20 firstActionButton = new Button()
24 firstActionButton.Clicked += (object sender, ClickedEventArgs e) =>
29 firstAppBar = new AppBar()
31 AutoNavigationContent = false
33 firstAppBar.SetTitle("First Page");
34 firstAppBar.AddActions(firstActionButton);
36 firstButton = new Button()
38 Text = "Click to next",
39 WidthSpecification = LayoutParamPolicies.MatchParent,
40 HeightSpecification = LayoutParamPolicies.MatchParent,
42 firstButton.Clicked += (object sender, ClickedEventArgs e) =>
47 firstPage = new Page(firstAppBar, firstButton);
49 NUIApplication.GetDefaultWindow().GetDefaultNavigator().Push(firstPage);
52 private void CreateSecondPage()
54 secondActionButton = new Button()
58 secondActionButton.Clicked += (object sender, ClickedEventArgs e) =>
60 NUIApplication.GetDefaultWindow().GetDefaultNavigator().Pop();
63 secondAppBar = new AppBar();
64 secondAppBar.SetTitle("Second Page");
65 secondAppBar.AddActions(secondActionButton);
67 secondButton = new Button()
69 Text = "Click to prev",
70 WidthSpecification = LayoutParamPolicies.MatchParent,
71 HeightSpecification = LayoutParamPolicies.MatchParent,
73 secondButton.Clicked += (object sender, ClickedEventArgs e) =>
75 NUIApplication.GetDefaultWindow().GetDefaultNavigator().Pop();
78 secondPage = new Page(secondAppBar, secondButton);
80 NUIApplication.GetDefaultWindow().GetDefaultNavigator().Push(secondPage);
83 public void Deactivate()
85 NUIApplication.GetDefaultWindow().GetDefaultNavigator().Remove(secondPage);
89 secondActionButton = null;
92 NUIApplication.GetDefaultWindow().GetDefaultNavigator().Remove(firstPage);
96 firstActionButton = null;