Xamarin.Forms Guides | Samples

Xamarin.Forms.NavigationPage Class

A Page that manages the navigation and user-experience of a stack of other pages.

See Also: NavigationPage

Syntax

[Xamarin.Forms.RenderWith(typeof(Xamarin.Forms.Platform._NavigationPageRenderer))]
public class NavigationPage : Page, IElementConfiguration<NavigationPage>, INavigationPageController, IPageContainer<Page>

Remarks

Note that on the Android platform, INavigation operations do not generate activity lifecycle notifications. For each Page that you push or pop, the Android implementation of NavigationPage simply adds or removes the content of the page to or from a single activity.

Also note that the Windows Phone platform provides navigation natively. Therefore, you do not need to use a NavigationPage object to get navigation on that platform.

Requirements

Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions: 1.0.0.0, 1.1.0.0, 1.2.0.0, 1.3.0.0, 1.4.0.0, 1.5.0.0, 2.0.0.0

The members of Xamarin.Forms.NavigationPage are listed below.

See Also: Page

Public Constructors

Initializes a new NavigationPage object.
Creates a new NavigationPage element with root as its root element.

Public Fields

static readonly
BackButtonTitlePropertyBindableProperty. Identifies the property associated with the title of the back button.
static readonly
BarBackgroundColorPropertyBindableProperty. Identifies the property associated with the color of the NavigationPage's bar background color.
static readonly
BarTextColorPropertyBindableProperty. Identifies the property associated with the color of the NavigationPage's bar text color.
static readonly
CurrentPagePropertyBindableProperty. Identifies the NavigationPage.CurrentPage property.
static readonly
HasBackButtonPropertyBindableProperty. Backing store for the HasBackButton property.
static readonly
HasNavigationBarPropertyBindableProperty. Backing store for the HasNavigationBar property.
static readonly
TintPropertyBindableProperty. Identifies the NavigationPage.Tint bindable property.
static readonly
TitleIconPropertyBindableProperty. Indicates the NavigationPage.SetTitleIcon/NavigationPage.GetTitleIcon property.

Public Properties

BarBackgroundColorColor. Gets or sets the background color for the bar at the top of the NavigationPage.
BarTextColorColor. Gets or sets the text that appears on the bar at the top of the NavigationPage.
[read-only]
CurrentPagePage. The Page that is currently top-most on the navigation stack.
TintColor. The color to be used as the Tint of the NavigationPage.

Public Methods

static
GetBackButtonTitle(BindableObject) : String
The title of the back button for the specified page.
static
GetHasBackButton(Page) : Boolean
Returns a value that indicates whether page has a back button.
static
GetHasNavigationBar(BindableObject) : Boolean
Returns a value that indicates whether the page has a navigation bar.
static
GetTitleIcon(BindableObject) : FileImageSource
Retrieves the path to the file providing the title icon for the bindable.
On<T>() : IPlatformElementConfiguration<T, NavigationPage>
Returns the platform-specific instance of this NavigationPage, on which a platform-specific method may be called.
PopAsync() : System.Threading.Tasks.Task<Page>
Asynchronously removes the top Page from the navigation stack.
PopAsync(Boolean) : System.Threading.Tasks.Task<Page>
Asynchronously removes the top Page from the navigation stack, with optional animation.
PopToRootAsync() : Task
Pops all but the root Page off the navigation stack.
PopToRootAsync(Boolean) : Task
A task for asynchronously popping all pages off of the navigation stack.
PushAsync(Page) : Task
Presents a Page modally.
PushAsync(Page, Boolean) : Task
A task for asynchronously pushing a page onto the navigation stack, with optional animation.
static
SetBackButtonTitle(BindableObject, String)
Sets the title that appears on the back button for page.
static
SetHasBackButton(Page, Boolean)
Adds or removes a back button to page, with optional animation.
static
SetHasNavigationBar(BindableObject, Boolean)
Sets a value that indicates whether or not this NavigationPage element has a navigation bar.
static
SetTitleIcon(BindableObject, FileImageSource)
Sets the title icon of the bindable to the icon file at value.

Protected Methods

override
OnBackButtonPressed() : Boolean
Event that is raised when the hardware back button is pressed. This event is not raised on iOS.

Public Events

PoppedEvent that is raised after a page is popped from this NavigationPage element.
PoppedToRootEvent that is raised when the last nonroot element is popped from this NavigationPage element.
PushedEvent that is raised when a page is pushed onto this NavigationPage element.

Explicitly Implemented Interface Members