Class Navigator
Definition
- Namespace:
- Tizen.NUI.Components
- Assembly:
- Tizen.NUI.Components.dll
The Navigator is a class which navigates pages with stack methods such as Push and Pop.
public class Navigator : Control, INotifyPropertyChanged, IDisposable
- Inheritance
-
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
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 SourceNavigator()
Creates a new instance of a Navigator.
Declaration
public Navigator()
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.
Properties
View SourcePageCount
Returns the count of pages in Navigator.
Declaration
public int PageCount { get; }
Property Value
Type | Description |
---|---|
int |
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.
Transition
Transition properties for the transition of View pair having same transition tag.
Declaration
public Transition Transition { get; set; }
Property Value
Type | Description |
---|---|
Transition |
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.
Methods
View SourceGetDefaultNavigator(Window)
Returns the default navigator of the given window.
Declaration
public static Navigator GetDefaultNavigator(Window window)
Parameters
Type | Name | Description |
---|---|---|
Window | window |
Returns
Type | Description |
---|---|
Navigator | The default navigator of the given window. |
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.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when the argument window is null. |
GetPage(int)
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
public Page GetPage(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of a page in Navigator. |
Returns
Type | Description |
---|---|
Page | The page of the given index in Navigator. |
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.
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
public int IndexOf(Page page)
Parameters
Type | Name | Description |
---|---|---|
Page | page | The page in Navigator. |
Returns
Type | Description |
---|---|
int | The index of the given page in Navigator. If the given page is not in the Navigator, then -1 is returned. |
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.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when the argument page is null. |
Insert(int, 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
public void Insert(int index, Page page)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of a page in Navigator where the page will be inserted. |
Page | page | The page to insert to Navigator. |
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.
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. |
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
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. |
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.
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. |
Peek()
Returns the page at the top of Navigator.
Declaration
public Page Peek()
Returns
Type | Description |
---|---|
Page | The page at the top of Navigator. |
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.
Pop()
Pops the top page from Navigator.
Declaration
public Page Pop()
Returns
Type | Description |
---|---|
Page | The popped page. |
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.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown when there is no page in Navigator. |
PopWithTransition()
Pops the top page from Navigator.
Declaration
public Page PopWithTransition()
Returns
Type | Description |
---|---|
Page | The popped page. |
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.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown when there is no page in Navigator. |
Push(Page)
Pushes a page to Navigator. If the page is already in Navigator, then it is not pushed.
Declaration
public void Push(Page page)
Parameters
Type | Name | Description |
---|---|---|
Page | page | The page to push to Navigator. |
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.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when the argument page is null. |
PushWithTransition(Page)
Pushes a page to Navigator. If the page is already in Navigator, then it is not pushed.
Declaration
public void PushWithTransition(Page page)
Parameters
Type | Name | Description |
---|---|---|
Page | page | The page to push to Navigator. |
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.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when the argument page is null. |
Remove(Page)
Removes a page from Navigator.
Declaration
public void Remove(Page page)
Parameters
Type | Name | Description |
---|---|---|
Page | page | The page to remove from Navigator. |
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.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when the argument page is null. |
RemoveAt(int)
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
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of a page in Navigator where the page will be removed. |
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.
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | Thrown when the index is less than 0, or greater than or equal to the number of pages. |
Events
View SourcePopped
An event fired when Pop of a page has been finished.
Declaration
public event EventHandler<PoppedEventArgs> Popped
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><PoppedEventArgs> |
Remarks
When you free resources in the Popped event handler, please make sure if the popped page is the page you find.
TransitionFinished
An event fired when Transition has been finished.
Declaration
public event EventHandler<EventArgs> TransitionFinished
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><System.EventArgs> |
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.