Class Navigator
Definition
- Namespace:
- Tizen.NUI.Components
- Assembly:
- Tizen.NUI.Components.dll
- API Level:
- 9
The Navigator is a class which navigates pages with stack methods such as Push and Pop.
C#Copypublic class Navigator : Control, IDynamicResourceHandler, IElement, INameScope, IElementController, System.IDisposable, IResourcesProvider
- Inheritance
- Implements
Remarks
With Transition class, Navigator supports smooth transition of View pair between two Pages by using PushWithTransition(Page) and PopWithTransition() methods. If current top Page and next top Page have Views those have same TransitionTag, Navigator creates smooth transition motion for them. Navigator.Transition property can be used to set properties of the Transition such as TimePeriod and AlphaFunction. When all transitions are finished, Navigator calls a callback methods those connected on the "TransitionFinished" event.
Examples
CopyNavigator navigator = new Navigator() { TimePeriod = new TimePeriod(500), AlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseInOutSine) }; View view = new View() { TransitionOptions = new TransitionOptions() { /* Set properties for the transition of this View */ } }; ContentPage newPage = new ContentPage() { Content = view, }; Navigator.PushWithTransition(newPage);
Constructors
Declaration
C#Copypublic Navigator()
API Level: 9
Declaration
C#Copypublic Navigator(string style)
Parameters
Type | Name | Description |
---|---|---|
String | style | Creates Navigator by special style defined in UX. |
Declaration
C#Copypublic Navigator(ControlStyle style)
Parameters
Type | Name | Description |
---|---|---|
ControlStyle | style | A style applied to the newly created Navigator. |
Fields
Declaration
C#Copypublic static readonly BindableProperty EnableBackNavigationProperty
Field Value
Type | Description |
---|---|
BindableProperty |
Declaration
C#Copypublic static readonly BindableProperty TransitionProperty
Field Value
Type | Description |
---|---|
BindableProperty |
Properties
EnableBackNavigation
Gets or sets if Navigator proceeds back navigation when back button or back key is pressed and released. Back navigation pops the peek page if Navigator has more than one page. If Navigator has only one page, then the current program is exited.
Declaration
C#Copypublic bool EnableBackNavigation { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Declaration
C#Copypublic int PageCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: 9
Transition
Transition properties for the transition of View pair having same transition tag.
Declaration
C#Copypublic Transition Transition { get; set; }
Property Value
Type | Description |
---|---|
Transition |
API Level: 9
Methods
Declaration
C#Copyprotected override void Dispose(DisposeTypes type)
Parameters
Type | Name | Description |
---|---|---|
DisposeTypes | type | Dispose type. |
Overrides
Declaration
C#Copypublic static Navigator GetDefaultNavigator(Window window)
Parameters
Type | Name | Description |
---|---|---|
Window | window |
Returns
Type | Description |
---|---|
Navigator | The default navigator of the given window. |
API Level: 9
GetPage(Int32)
Returns the page of the given index in Navigator. The indices of pages in Navigator are basically the order of pushing or inserting to Navigator. So a page's index in Navigator can be changed whenever push/insert or pop/remove occurs.
Declaration
C#Copypublic Page GetPage(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The index of a page in Navigator. |
Returns
Type | Description |
---|---|
Page | The page of the given index in Navigator. |
IndexOf(Page)
Returns the current index of the given page in Navigator. The indices of pages in Navigator are basically the order of pushing or inserting to Navigator. So a page's index in Navigator can be changed whenever push/insert or pop/remove occurs.
Declaration
C#Copypublic int IndexOf(Page page)
Parameters
Type | Name | Description |
---|---|---|
Page | page | The page in Navigator. |
Returns
Type | Description |
---|---|
Int32 | The index of the given page in Navigator. If the given page is not in the Navigator, then -1 is returned. |
API Level: 9
Insert(Int32, Page)
Inserts a page at the specified index of Navigator. The indices of pages in Navigator are basically the order of pushing or inserting to Navigator. So a page's index in Navigator can be changed whenever push/insert or pop/remove occurs. To find the current index of a page in Navigator, please use IndexOf(page). If the page is already in Navigator, then it is not inserted.
Declaration
C#Copypublic void Insert(int index, Page page)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The index of a page in Navigator where the page will be inserted. |
Page | page | The page to insert to Navigator. |
API Level: 9
InsertBefore(Page, Page)
Inserts a page to Navigator before an existing page. If the page is already in Navigator, then it is not inserted.
Declaration
C#Copypublic void InsertBefore(Page before, Page page)
Parameters
Type | Name | Description |
---|---|---|
Page | before | The existing page, before which a page will be inserted. |
Page | page | The page to insert to Navigator. |
API Level: 9
OnBackNavigation(BackNavigationEventArgs)
Called when the back navigation is started. Back navigation pops the peek page if Navigator has more than one page. If Navigator has only one page, then the current program is exited.
Declaration
C#Copyprotected virtual void OnBackNavigation(BackNavigationEventArgs eventArgs)
Parameters
Type | Name | Description |
---|---|---|
BackNavigationEventArgs | eventArgs | The back navigation information. |
Declaration
C#Copypublic override void OnInitialize()
Overrides
Declaration
C#Copypublic Page Peek()
Returns
Type | Description |
---|---|
Page | The page at the top of Navigator. |
API Level: 9
Declaration
C#Copypublic Page Pop()
Returns
Type | Description |
---|---|
Page | The popped page. |
API Level: 9
Declaration
C#Copypublic Page PopWithTransition()
Returns
Type | Description |
---|---|
Page | The popped page. |
API Level: 9
Push(Page)
Pushes a page to Navigator. If the page is already in Navigator, then it is not pushed.
Declaration
C#Copypublic void Push(Page page)
Parameters
Type | Name | Description |
---|---|---|
Page | page | The page to push to Navigator. |
API Level: 9
PushWithTransition(Page)
Pushes a page to Navigator. If the page is already in Navigator, then it is not pushed.
Declaration
C#Copypublic void PushWithTransition(Page page)
Parameters
Type | Name | Description |
---|---|---|
Page | page | The page to push to Navigator. |
API Level: 9
Declaration
C#Copypublic void Remove(Page page)
Parameters
Type | Name | Description |
---|---|---|
Page | page | The page to remove from Navigator. |
API Level: 9
RemoveAt(Int32)
Removes a page at the specified index of Navigator. The indices of pages in Navigator are basically the order of pushing or inserting to Navigator. So a page's index in Navigator can be changed whenever push/insert or pop/remove occurs. To find the current index of a page in Navigator, please use IndexOf(page).
Declaration
C#Copypublic void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The index of a page in Navigator where the page will be removed. |
API Level: 9
SetDefaultNavigator(Window, Navigator)
Sets the default navigator of the given window. SetDefaultNavigator does not remove the previous default navigator from the window. Therefore, if a user does not want to show the previous default navigator, then it should be removed from the window manually.
Declaration
C#Copypublic static void SetDefaultNavigator(Window window, Navigator newNavigator)
Parameters
Type | Name | Description |
---|---|---|
Window | window | |
Navigator | newNavigator |
Events
Declaration
C#Copypublic event EventHandler<PoppedEventArgs> Popped
Event Type
Type | Description |
---|---|
EventHandler<PoppedEventArgs> |
Remarks
When you free resources in the Popped event handler, please make sure if the popped page is the page you find.
API Level: 9
Declaration
C#Copypublic event EventHandler<EventArgs> TransitionFinished
Event Type
Type | Description |
---|---|
EventHandler<EventArgs> |