1 using System.Collections.Generic;
2 using System.Collections.ObjectModel;
3 using Tizen.NUI.BaseComponents;
4 using Tizen.NUI.Components;
6 namespace Tizen.NUI.Samples
8 public class AppBarSample : IExample
10 private ContentPage firstPage, secondPage;
11 private AppBar firstAppBar, secondAppBar;
12 private Button firstActionButton, secondActionButton;
13 private Button firstButton, secondButton;
15 public void Activate()
20 private void CreateFirstPage()
22 firstActionButton = new Button()
26 firstActionButton.Clicked += (object sender, ClickedEventArgs e) =>
31 firstAppBar = new AppBar()
33 AutoNavigationContent = false,
35 Actions = new View[] { firstActionButton },
38 firstButton = new Button()
40 Text = "Click to next",
41 WidthSpecification = LayoutParamPolicies.MatchParent,
42 HeightSpecification = LayoutParamPolicies.MatchParent,
44 firstButton.Clicked += (object sender, ClickedEventArgs e) =>
49 firstPage = new ContentPage()
52 Content = firstButton,
55 NUIApplication.GetDefaultWindow().GetDefaultNavigator().Push(firstPage);
58 private void CreateSecondPage()
60 secondActionButton = new Button()
64 secondActionButton.Clicked += (object sender, ClickedEventArgs e) =>
66 NUIApplication.GetDefaultWindow().GetDefaultNavigator().Pop();
69 secondAppBar = new AppBar()
71 Title = "Second Page",
72 Actions = new View[] { secondActionButton },
75 secondButton = new Button()
77 Text = "Click to prev",
78 WidthSpecification = LayoutParamPolicies.MatchParent,
79 HeightSpecification = LayoutParamPolicies.MatchParent,
81 secondButton.Clicked += (object sender, ClickedEventArgs e) =>
83 NUIApplication.GetDefaultWindow().GetDefaultNavigator().Pop();
86 secondPage = new ContentPage()
88 AppBar = secondAppBar,
89 Content = secondButton,
92 NUIApplication.GetDefaultWindow().GetDefaultNavigator().Push(secondPage);
95 public void Deactivate()
97 NUIApplication.GetDefaultWindow().GetDefaultNavigator().Remove(secondPage);
101 secondActionButton = null;
104 NUIApplication.GetDefaultWindow().GetDefaultNavigator().Remove(firstPage);
108 firstActionButton = null;