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, INotifyPropertyChanged, IDynamicResourceHandler, IElement, INameScope, IElementController, IDisposable, IResourcesProvider
- Inheritance
-
System.ObjectTizen.NUI.Binding.ElementTizen.NUI.Components.ControlNavigator
- Implements
-
System.ComponentModel.INotifyPropertyChangedSystem.IDisposable
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
Properties
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#Copypublic static Navigator GetDefaultNavigator(Window window)
Parameters
Type | Name | Description |
---|---|---|
Window | window |
Returns
Type | Description |
---|---|
Navigator | The default navigator of the given window. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when the argument window is null. |
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. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | Thrown when the argument index is less than 0, or greater than the number of pages. |
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. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when the argument page is null. |
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. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | Thrown when the argument index is less than 0, or greater than the number of pages. |
System.ArgumentNullException | Thrown when the argument page is null. |
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. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when the argument before is null. |
System.ArgumentNullException | Thrown when the argument page is null. |
System.ArgumentException | Thrown when the argument before does not exist in Navigator. |
API Level: 9
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. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown when there is no page in Navigator. |
API Level: 9
Declaration
C#Copypublic Page PopWithTransition()
Returns
Type | Description |
---|---|
Page | The popped page. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown when there is no page in Navigator. |
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. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when the argument page is null. |
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. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when the argument page is null. |
API Level: 9
Declaration
C#Copypublic void Remove(Page page)
Parameters
Type | Name | Description |
---|---|---|
Page | page | The page to remove from Navigator. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when the argument page is null. |
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. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | Thrown when the index is less than 0, or greater than or equal to the number of pages. |
API Level: 9
Events
Declaration
C#Copypublic event EventHandler<PoppedEventArgs> Popped
Event Type
Type | Description |
---|---|
System.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 |
---|---|
System.EventHandler<EventArgs> |