Xamarin.Forms Guides | Samples

Xamarin.Forms.Page Class

A VisualElement that occupies the entire screen.

See Also: Page

Syntax

[Xamarin.Forms.RenderWith(typeof(Xamarin.Forms.Platform._PageRenderer))]
public class Page : VisualElement, IElementConfiguration<Page>, ILayout, IPageController

Remarks

Page is primarily a base class for more useful derived types. Objects that are derived from the Page class are most prominently used as the top level UI element in Xamarin.Forms applications. In addition to their role as the main pages of Xamarin.Forms applications, Page objects and their descendants can be used with navigation classes, such as Navigation or MasterDetailPage, among others, to provide rich user experiences that conform to the expected behaviors on each 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.Page are listed below.

See Also: VisualElement

Public Constructors

Creates a new Page element with default values.

Public Fields

const
ActionSheetSignalNameString. This method is for internal use.
const
AlertSignalNameString. This method is for internal use .
static readonly
BackgroundImagePropertyBindableProperty. Identifies the Page.BackgroundImage property.
const
BusySetSignalNameString. This method is for internal use.
static readonly
IconPropertyBindableProperty. Identifies the Page.Icon property.
static readonly
IsBusyPropertyBindableProperty. Identifies the Page.IsBusy property.
static readonly
PaddingPropertyBindableProperty. Identifies the Page.Padding property.
static readonly
TitlePropertyBindableProperty. Identifies the Page.Title property.

Public Properties

BackgroundImageString. Identifies the image used as a background for the Page.
IconFileImageSource. Resource identifier for the Page's associated icon.
IsBusyBoolean. Marks the Page as busy. This will cause the platform specific global activity indicator to show a busy state.
PaddingThickness. The space between the content of the Page and it's border.
TitleString. The Page's title.
[read-only]
ToolbarItemsIList<ToolbarItem>. A set of ToolbarItems, implemented in a platform-specific manner.

Public Methods

DisplayActionSheet(String, String, String, params String[]) : System.Threading.Tasks.Task<string>
Displays a native platform action sheet, allowing the application user to choose from several buttons.
DisplayAlert(String, String, String) : Task
Presents an alert dialog to the application user with a single cancel button.
DisplayAlert(String, String, String, String) : System.Threading.Tasks.Task<bool>
Presents an alert dialog to the application user with an accept and a cancel button.
ForceLayout()
Forces the Page to perform a layout pass.
On<T>() : IPlatformElementConfiguration<T, Page>
TReturns the platform-specific instance of this Page, on which a platform-specific method may be called.
SendBackButtonPressed() : Boolean
Calls Page.OnBackButtonPressed.

Protected Methods

LayoutChildren(Double, Double, Double, Double)
Lays out children Elements into the specified area.
OnAppearing()
When overridden, allows application developers to customize behavior immediately prior to the Page becoming visible.
OnBackButtonPressed() : Boolean
Application developers can override this method to provide behavior when the back button is pressed.
override
OnBindingContextChanged()
Invoked whenever the binding context of the Page changes. Override this method to add class handling for this event.
OnChildMeasureInvalidated(Object, EventArgs)
Indicates that the preferred size of a child Element has changed.
OnDisappearing()
When overridden, allows the application developer to customize behavior as the Page disappears.
override
OnParentSet()
Called when the Page's Element.Parent property has changed.
override
OnSizeAllocated(Double, Double)
Indicates that the Page has been assigned a size.
UpdateChildrenLayout()
Requests that the children Elements of the Page update their layouts.

Public Events

AppearingIndicates that the Page is about to appear.
DisappearingIndicates that the Page is about to cease displaying.
LayoutChangedRaised when the layout of the Page has changed.

Explicitly Implemented Interface Members