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#
Copy
public class Navigator : Control, INotifyPropertyChanged, IDynamicResourceHandler, IElement, INameScope, IElementController, IDisposable, IResourcesProvider
Inheritance
System.Object
Tizen.NUI.Binding.Element
Tizen.NUI.Components.Control
Navigator
Implements
System.ComponentModel.INotifyPropertyChanged
System.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
Copy
Navigator 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

View Source

Navigator()

Creates a new instance of a Navigator.

Declaration
C#
Copy
public Navigator()
API Level: 9

Properties

View Source

PageCount

Returns the count of pages in Navigator.

Declaration
C#
Copy
public int PageCount { get; }
Property Value
Type Description
Int32
API Level: 9
View Source

Transition

Transition properties for the transition of View pair having same transition tag.

Declaration
C#
Copy
public Transition Transition { get; set; }
Property Value
Type Description
Transition
API Level: 9

Methods

View Source

GetDefaultNavigator(Window)

Returns the default navigator of the given window.

Declaration
C#
Copy
public 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
View Source

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#
Copy
public 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.

View Source

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#
Copy
public 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
View Source

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#
Copy
public 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
View Source

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#
Copy
public 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
View Source

Peek()

Returns the page at the top of Navigator.

Declaration
C#
Copy
public Page Peek()
Returns
Type Description
Page

The page at the top of Navigator.

API Level: 9
View Source

Pop()

Pops the top page from Navigator.

Declaration
C#
Copy
public 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
View Source

PopWithTransition()

Pops the top page from Navigator.

Declaration
C#
Copy
public 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
View Source

Push(Page)

Pushes a page to Navigator. If the page is already in Navigator, then it is not pushed.

Declaration
C#
Copy
public 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
View Source

PushWithTransition(Page)

Pushes a page to Navigator. If the page is already in Navigator, then it is not pushed.

Declaration
C#
Copy
public 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
View Source

Remove(Page)

Removes a page from Navigator.

Declaration
C#
Copy
public 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
View Source

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#
Copy
public 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

View Source

Popped

An event fired when Pop of a page has been finished.

Declaration
C#
Copy
public 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
View Source

TransitionFinished

An event fired when Transition has been finished.

Declaration
C#
Copy
public event EventHandler<EventArgs> TransitionFinished
Event Type
Type Description
System.EventHandler<EventArgs>
API Level: 9

Implements

System.ComponentModel.INotifyPropertyChanged
System.IDisposable