ページ Class

Frame コントロールで移動できる先のコンテンツを表します。

継承

Object
  DependencyObject
    UIElement
      FrameworkElement
        Control
          UserControl
            Page

構文


public class Page : UserControl


<Page .../>
-or-
<Page ...>
  singleRootElement
</Page>

XAML Values

singleRootElement

XAML コンポジション内の深い階層に位置する目的のページ コンテンツを格納している 1 つの XAML オブジェクト要素。通常、これはパネルまたは項目コントロールです。

属性

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

メンバー

Pageクラス には次の種類のメンバーがあります。

コンストラクター

Pageクラス にはこれらのコンストラクターがあります。

コンストラクター説明
Page Initializes a new instance of the Page class.

 

イベント

Pageクラス にはこれらのイベントがあります。

イベント説明
DataContextChanged Occurs when the value of the FrameworkElement.DataContext property changes. (継承元 FrameworkElement)
DoubleTapped Occurs when an otherwise unhandled DoubleTap interaction occurs over the hit test area of this element. (継承元 UIElement)
DragEnter Occurs when the input system reports an underlying drag event with this element as the target. (継承元 UIElement)
DragLeave Occurs when the input system reports an underlying drag event with this element as the origin. (継承元 UIElement)
DragOver Occurs when the input system reports an underlying drag event with this element as the potential drop target. (継承元 UIElement)
Drop Occurs when the input system reports an underlying drop event with this element as the drop target. (継承元 UIElement)
GotFocus Occurs when a UIElement receives focus. (継承元 UIElement)
Holding Occurs when an otherwise unhandled Hold interaction occurs over the hit test area of this element. (継承元 UIElement)
IsEnabledChanged Occurs when the IsEnabled property changes. (継承元 Control)
KeyDown Occurs when a keyboard key is pressed while the UIElement has focus. (継承元 UIElement)
KeyUp Occurs when a keyboard key is released while the UIElement has focus. (継承元 UIElement)
LayoutUpdated Occurs when the layout of the visual tree changes, due to layout-relevant properties changing value or some other action that refreshes the layout. (継承元 FrameworkElement)
Loaded Occurs when a FrameworkElement has been constructed and added to the object tree, and is ready for interaction. (継承元 FrameworkElement)
LostFocus Occurs when a UIElement loses focus. (継承元 UIElement)
ManipulationCompleted Occurs when a manipulation on the UIElement is complete. (継承元 UIElement)
ManipulationDelta Occurs when the input device changes position during a manipulation. (継承元 UIElement)
ManipulationInertiaStarting Occurs when the input device loses contact with the UIElement object during a manipulation and inertia begins. (継承元 UIElement)
ManipulationStarted Occurs when an input device begins a manipulation on the UIElement. (継承元 UIElement)
ManipulationStarting Occurs when the manipulation processor is first created. (継承元 UIElement)
PointerCanceled Occurs when a pointer that made contact abnormally loses contact. (継承元 UIElement)
PointerCaptureLost Occurs when pointer capture previously held by this element moves to another element or elsewhere. (継承元 UIElement)
PointerEntered Occurs when a pointer enters the hit test area of this element. (継承元 UIElement)
PointerExited Occurs when a pointer leaves the hit test area of this element. (継承元 UIElement)
PointerMoved Occurs when a pointer moves while the pointer remains within the hit test area of this element. (継承元 UIElement)
PointerPressed Occurs when the pointer device initiates a Press action within this element. (継承元 UIElement)
PointerReleased Occurs when the pointer device that previously initiated a Press action is released, while within this element. (継承元 UIElement)
PointerWheelChanged Occurs when the delta value of a pointer wheel changes. (継承元 UIElement)
RightTapped Occurs when a right-tap input stimulus happens while the pointer is over the element. (継承元 UIElement)
SizeChanged Occurs when either the ActualHeight or the ActualWidth property changes value on a FrameworkElement. (継承元 FrameworkElement)
Tapped Occurs when an otherwise unhandled Tap interaction occurs over the hit test area of this element. (継承元 UIElement)
Unloaded Occurs when this object is no longer connected to the main object tree. (継承元 FrameworkElement)

 

メソッド

The Page クラス には次のメソッドがあります。 また、以下からもメソッドが継承されます。Object クラス.

メソッド説明
AddHandler Adds a routed event handler for a specified routed event, adding the handler to the handler collection on the current element. Specify handledEventsToo as true to have the provided handler be invoked even if the event is handled elsewhere. (継承元 UIElement)
ApplyTemplate Loads the relevant control template so that its parts can be referenced. (継承元 Control)
Arrange Positions child objects and determines a size for a UIElement. Parent objects that implement custom layout for their child elements should call this method from their layout override implementations to form a recursive layout update. (継承元 UIElement)
ArrangeOverride Provides the behavior for the Arrange pass of layout. Classes can override this method to define their own Arrange pass behavior. (継承元 FrameworkElement)
CancelDirectManipulations Cancels ongoing direct manipulation processing (system-defined panning/zooming) on any ScrollViewer parent that contains the current UIElement. (継承元 UIElement)
CapturePointer Sets pointer capture to a UIElement. Once captured, only the element that has capture will fire pointer-related events. (継承元 UIElement)
ClearValue Clears the local value of a dependency property. (継承元 DependencyObject)
FindName Retrieves an object that has the specified identifier name. (継承元 FrameworkElement)
FindSubElementsForTouchTargeting Enables a UIElement subclass to expose child elements that assist with resolving touch targeting. (継承元 UIElement)
Focus Attempts to set the focus on the control. (継承元 Control)
GetAnimationBaseValue Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (継承元 DependencyObject)
GetBindingExpression Returns the BindingExpression that represents the binding on the specified property. (継承元 FrameworkElement)
GetTemplateChild Retrieves the named element in the instantiated ControlTemplate visual tree. (継承元 Control)
GetValue Returns the current effective value of a dependency property from a DependencyObject. (継承元 DependencyObject)
GoToElementStateCore When implemented in a derived class, enables per-state construction of a visual tree for a control template in code, rather than by loading XAML for all states at control startup. (継承元 FrameworkElement)
InvalidateArrange Invalidates the arrange state (layout) for a UIElement. After the invalidation, the UIElement will have its layout updated, which will occur asynchronously. (継承元 UIElement)
InvalidateMeasure Invalidates the measurement state (layout) for a UIElement. (継承元 UIElement)
Measure Updates the DesiredSize of a UIElement. Typically, objects that implement custom layout for their layout children call this method from their own MeasureOverride implementations to form a recursive layout update. (継承元 UIElement)
MeasureOverride Provides the behavior for the Measure pass of the layout cycle. Classes can override this method to define their own Measure pass behavior. (継承元 FrameworkElement)
OnApplyTemplate Invoked whenever application code or internal processes (such as a rebuilding layout pass) call ApplyTemplate. In simplest terms, this means the method is called just before a UI element displays in your app. Override this method to influence the default post-template logic of a class. (継承元 FrameworkElement)
OnCreateAutomationPeer When implemented in a derived class, returns class-specific AutomationPeer implementations for the Microsoft UI Automation infrastructure. (継承元 UIElement)
OnDisconnectVisualChildren Override this method to implement how layout and logic should behave when items are removed from a class-specific content or children property. (継承元 UIElement)
OnDoubleTapped Called before the DoubleTapped event occurs. (継承元 Control)
OnDragEnter Called before the DragEnter event occurs. (継承元 Control)
OnDragLeave Called before the DragLeave event occurs. (継承元 Control)
OnDragOver Called before the DragOver event occurs. (継承元 Control)
OnDrop Called before the Drop event occurs. (継承元 Control)
OnGotFocus Called before the GotFocus event occurs. (継承元 Control)
OnHolding Called before the Holding event occurs. (継承元 Control)
OnKeyDown Called before the KeyDown event occurs. (継承元 Control)
OnKeyUp Called before the KeyUp event occurs. (継承元 Control)
OnLostFocus Called before the LostFocus event occurs. (継承元 Control)
OnManipulationCompleted Called before the ManipulationCompleted event occurs. (継承元 Control)
OnManipulationDelta Called before the ManipulationDelta event occurs. (継承元 Control)
OnManipulationInertiaStarting Called before the ManipulationInertiaStarting event occurs. (継承元 Control)
OnManipulationStarted Called before the ManipulationStarted event occurs. (継承元 Control)
OnManipulationStarting Called before the ManipulationStarting event occurs. (継承元 Control)
OnNavigatedFrom Invoked immediately after the Page is unloaded and is no longer the current source of a parent Frame.
OnNavigatedTo Invoked when the Page is loaded and becomes the current source of a parent Frame.
OnNavigatingFrom Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.
OnPointerCanceled Called before the PointerCanceled event occurs. (継承元 Control)
OnPointerCaptureLost Called before the PointerCaptureLost event occurs. (継承元 Control)
OnPointerEntered Called before the PointerEntered event occurs. (継承元 Control)
OnPointerExited Called before the PointerExited event occurs. (継承元 Control)
OnPointerMoved Called before the PointerMoved event occurs. (継承元 Control)
OnPointerPressed Called before the PointerPressed event occurs. (継承元 Control)
OnPointerReleased Called before the PointerReleased event occurs. (継承元 Control)
OnPointerWheelChanged Called before the PointerWheelChanged event occurs. (継承元 Control)
OnRightTapped Called before the RightTapped event occurs. (継承元 Control)
OnTapped Called before the Tapped event occurs. (継承元 Control)
ReadLocalValue Returns the local value of a dependency property, if a local value is set. (継承元 DependencyObject)
ReleasePointerCapture Releases pointer captures for capture of one specific pointer by this UIElement. (継承元 UIElement)
ReleasePointerCaptures Releases all pointer captures held by this element. (継承元 UIElement)
RemoveHandler Removes the specified routed event handler from this UIElement. Typically the handler in question was added by AddHandler. (継承元 UIElement)
SetBinding Attaches a binding to a FrameworkElement, using the provided binding object. (継承元 FrameworkElement)
SetValue Sets the local value of a dependency property on a DependencyObject. (継承元 DependencyObject)
TransformToVisual Returns a transform object that can be used to transform coordinates from the UIElement to the specified object. (継承元 UIElement)
UpdateLayout Ensures that all positions of child objects of a UIElement are properly updated for layout. (継承元 UIElement)

 

プロパティ

Pageクラス には次のプロパティがあります。

プロパティアクセスの種類説明

ActualHeight

読み取り専用Gets the rendered height of a FrameworkElement. (継承元 FrameworkElement)

ActualWidth

読み取り専用Gets the rendered width of a FrameworkElement. (継承元 FrameworkElement)

AllowDrop

読み取り/書き込みGets or sets a value that determines whether this UIElement can be a drop target for purposes of drag-and-drop operations. (継承元 UIElement)

Background

読み取り/書き込みGets or sets a brush that provides the background of the control. (継承元 Control)

BaseUri

読み取り専用Gets a Uniform Resource Identifier (URI) that represents the base Uniform Resource Identifier (URI) for an XAML-constructed object at XAML load time. This property is useful for Uniform Resource Identifier (URI) resolution at run time. (継承元 FrameworkElement)

BorderBrush

読み取り/書き込みGets or sets a brush that describes the border background of a control. (継承元 Control)

BorderThickness

読み取り/書き込みGets or sets the border thickness of a control. (継承元 Control)

BottomAppBar

読み取り/書き込みGets a reference to an AppBar displayed at the bottom of the page, if any.

BottomAppBarProperty

読み取り専用Identifies the BottomAppBar dependency property.

CacheMode

読み取り/書き込みGets or sets a value that indicates that rendered content should be cached as a composited bitmap when possible. (継承元 UIElement)

CharacterSpacing

読み取り/書き込みGets or sets the uniform spacing between characters, in units of 1/1000 of an em. (継承元 Control)

Clip

読み取り/書き込みGets or sets the RectangleGeometry used to define the outline of the contents of a UIElement. (継承元 UIElement)

CompositeMode

読み取り/書き込みGets or sets a property that declares alternate composition and blending modes for the element in its parent layout and window. This is relevant for elements that are involved in a mixed XAML / Microsoft DirectX UI. (継承元 UIElement)

Content

読み取り/書き込みGets or sets the content that is contained within a user control. (継承元 UserControl)

DataContext

読み取り/書き込みGets or sets the data context for a FrameworkElement when it participates in data binding. (継承元 FrameworkElement)

DefaultStyleKey

読み取り/書き込みGets or sets the key that references the default style for the control. Authors of custom controls use this property to change the default for the style that their control uses. (継承元 Control)

DesiredSize

読み取り専用Gets the size that this UIElement computed during the measure pass of the layout process. (継承元 UIElement)

Dispatcher

読み取り専用Gets the CoreDispatcher that this object is associated with. (継承元 DependencyObject)

FlowDirection

読み取り/書き込みGets or sets the direction in which text and other UI elements flow within any parent element that controls their layout. This property can be set to either LeftToRight or RightToLeft. Setting FlowDirection to RightToLeft on any element sets the alignment to the right, the reading order to right-to-left and the layout of the control to flow from right to left. (継承元 FrameworkElement)

FocusState

読み取り専用Gets a value that specifies whether this control has focus, and the mode by which focus was obtained. (継承元 Control)

FontFamily

読み取り/書き込みGets or sets the font used to display text in the control. (継承元 Control)

FontSize

読み取り/書き込みGets or sets the size of the text in this control. (継承元 Control)

FontStretch

読み取り/書き込みGets or sets the degree to which a font is condensed or expanded on the screen. (継承元 Control)

FontStyle

読み取り/書き込みGets or sets the style in which the text is rendered. (継承元 Control)

FontWeight

読み取り/書き込みGets or sets the thickness of the specified font. (継承元 Control)

Foreground

読み取り/書き込みGets or sets a brush that describes the foreground color. (継承元 Control)

Frame

読み取り専用Gets the controlling Frame for the Page content.

FrameProperty

読み取り専用Identifies the Frame dependency property.

Height

読み取り/書き込みGets or sets the suggested height of a FrameworkElement. (継承元 FrameworkElement)

HorizontalAlignment

読み取り/書き込みGets or sets the horizontal alignment characteristics that are applied to a FrameworkElement when it is composed in a layout parent, such as a panel or items control. (継承元 FrameworkElement)

HorizontalContentAlignment

読み取り/書き込みGets or sets the horizontal alignment of the control's content. (継承元 Control)

IsDoubleTapEnabled

読み取り/書き込みGets or sets a value that determines whether the DoubleTapped event can originate from that element. (継承元 UIElement)

IsEnabled

読み取り/書き込みGets or sets a value indicating whether the user can interact with the control. (継承元 Control)

IsHitTestVisible

読み取り/書き込みGets or sets whether the contained area of this UIElement can return true values for hit testing. (継承元 UIElement)

IsHoldingEnabled

読み取り/書き込みGets or sets a value that determines whether the Holding event can originate from that element. (継承元 UIElement)

IsRightTapEnabled

読み取り/書き込みGets or sets a value that determines whether the RightTapped event can originate from that element. (継承元 UIElement)

IsTabStop

読み取り/書き込みGets or sets a value that indicates whether a control is included in tab navigation. (継承元 Control)

IsTapEnabled

読み取り/書き込みGets or sets a value that determines whether the Tapped event can originate from that element. (継承元 UIElement)

Language

読み取り/書き込みGets or sets localization/globalization language information that applies to a FrameworkElement, and also to all child elements of the current FrameworkElement in the object representation and in UI. (継承元 FrameworkElement)

ManipulationMode

読み取り/書き込みGets or sets the ManipulationModes value used for UIElement behavior and interaction with gestures. Setting this value enables handling the manipulation events from this element in app code. (継承元 UIElement)

Margin

読み取り/書き込みGets or sets the outer margin of a FrameworkElement. (継承元 FrameworkElement)

MaxHeight

読み取り/書き込みGets or sets the maximum height constraint of a FrameworkElement. (継承元 FrameworkElement)

MaxWidth

読み取り/書き込みGets or sets the maximum width constraint of a FrameworkElement. (継承元 FrameworkElement)

MinHeight

読み取り/書き込みGets or sets the minimum height constraint of a FrameworkElement. (継承元 FrameworkElement)

MinWidth

読み取り/書き込みGets or sets the minimum width constraint of a FrameworkElement. (継承元 FrameworkElement)

Name

読み取り/書き込みGets or sets the identifying name of the object. When a XAML processor creates the object tree from XAML markup, run-time code can refer to the XAML-declared object by this name. (継承元 FrameworkElement)

NavigationCacheMode

読み取り/書き込みGets or sets the navigation mode that indicates whether this Page is cached, and the period of time that the cache entry should persist.

Opacity

読み取り/書き込みGets or sets the degree of the object's opacity. (継承元 UIElement)

Padding

読み取り/書き込みGets or sets the padding inside a control. (継承元 Control)

Parent

読み取り専用Gets the parent object of this FrameworkElement in the object tree. (継承元 FrameworkElement)

PointerCaptures

読み取り専用Gets the set of all captured pointers, represented as Pointer values. (継承元 UIElement)

Projection

読み取り/書き込みGets or sets the perspective projection (3-D effect) to apply when rendering this element. (継承元 UIElement)

RenderSize

読み取り専用Gets the final render size of a UIElement. (継承元 UIElement)

RenderTransform

読み取り/書き込みGets or sets transform information that affects the rendering position of a UIElement. (継承元 UIElement)

RenderTransformOrigin

読み取り/書き込みGets or sets the origin point of any possible render transform declared by RenderTransform, relative to the bounds of the UIElement. (継承元 UIElement)

RequestedTheme

読み取り/書き込みGets or sets the UI theme that is used by the UIElement (and its child elements) for resource determination. The UI theme you specify with RequestedTheme can override the app-level RequestedTheme. (継承元 FrameworkElement)

Resources

読み取り/書き込みGets the locally defined resource dictionary. In XAML, you can establish resource items as child object elements of a frameworkElement.Resources property element, through XAML implicit collection syntax. (継承元 FrameworkElement)

Style

読み取り/書き込みGets or sets an instance Style that is applied for this object during layout and rendering. (継承元 FrameworkElement)

TabIndex

読み取り/書き込みGets or sets a value that determines the order in which elements receive focus when the user navigates through controls by pressing the Tab key. (継承元 Control)

TabNavigation

読み取り/書き込みGets or sets a value that modifies how tabbing and TabIndex work for this control. (継承元 Control)

Tag

読み取り/書き込みGets or sets an arbitrary object value that can be used to store custom information about this object. (継承元 FrameworkElement)

Template

読み取り/書き込みGets or sets a control template. The control template defines the visual appearance of a control in UI, and is defined in XAML markup. (継承元 Control)

TopAppBar

読み取り/書き込みGets a reference to an AppBar displayed at the top of the page, if any.

TopAppBarProperty

読み取り専用Identifies the TopAppBar dependency property.

Transitions

読み取り/書き込みGets or sets the collection of Transition style elements that apply to a UIElement. (継承元 UIElement)

Triggers

読み取り専用Gets the collection of triggers for animations that are defined for a FrameworkElement. Not commonly used. (継承元 FrameworkElement)

UseLayoutRounding

読み取り/書き込みGets or sets a value that determines whether rendering for the object and its visual subtree should use rounding behavior that aligns rendering to whole pixels. (継承元 UIElement)

VerticalAlignment

読み取り/書き込みGets or sets the vertical alignment characteristics that are applied to a FrameworkElement when it is composed in a parent object such as a panel or items control. (継承元 FrameworkElement)

VerticalContentAlignment

読み取り/書き込みGets or sets the vertical alignment of the control's content. (継承元 Control)

Visibility

読み取り/書き込みGets or sets the visibility of a UIElement. A UIElement that is not visible is not rendered and does not communicate its desired size to layout. (継承元 UIElement)

Width

読み取り/書き込みGets or sets the width of a FrameworkElement. (継承元 FrameworkElement)

 

解説

Page クラスによって、Frame コントロールの移動先にすることができるコンテンツがカプセル化されます。一般的には、Page クラスから派生する独自のページの種類を作成し、Page を XAML で宣言されたコンテンツのルート要素として使用します。 アプリケーションにコンテンツを表示するために、必要に応じてさまざまな種類のページを作成します。その後で、Frame.Navigate メソッドを呼び出し、移動先のページの種類を渡すことによって、作成したページに移動します。ページを特定の状態に初期化するために、パラメーター オブジェクトを渡すこともできます。

既定では、各ナビゲーションによって、要求された特定の Page サブクラスの新しいインスタンスが作成され、前のページのインスタンスが破棄されます。これは、以前に訪問したページに戻る場合、または新しいページの種類が以前のページの種類と同じである場合に発生します。同じページへの頻繁なナビゲーションを含んでいるアプリケーションでは、ページのインスタンスをキャッシュおよび再利用することで、より効率的なナビゲーションを実現できます。これを行うには、Frame.CacheSize プロパティを設定してキャッシュするページ数を指定します。キャッシュするページの種類ごとに、NavigationCacheMode プロパティを Enabled または Required に設定する必要もあります。Required キャッシュ モードのページは、CacheSize の値に関係なくキャッシュされ、CacheSize の合計には加算されません。

ページの OnNavigatedTo メソッド、OnNavigatingFrom メソッド、OnNavigatedFrom メソッドをオーバーライドして、ページ状態の初期化や保存などのタスクを実行できます。

Visual Studio で空白のアプリケーション テンプレートに生成される OnLaunched メソッドのオーバーライドを次のコード例に示します。このコードは、アプリケーション ウィンドウのコンテンツが、設定後に既定の初期 Page に移動される、新しい Frame にどのように設定されるかを示しています。


protected override void OnLaunched(LaunchActivatedEventArgs args)
{
    // Create a Frame to act navigation context and navigate to the first page
    var rootFrame = new Frame();
    rootFrame.Navigate(typeof(MainPage));

    // Place the frame in the current Window and ensure that it is active
    Window.Current.Content = rootFrame;
    Window.Current.Activate();
}


要件

最小限サポートされるクライアント

Windows 8 [Windows ストア アプリのみ]

最小限サポートされるサーバー

Windows Server 2012 [Windows ストア アプリのみ]

名前空間

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

メタデータ

Windows.winmd

参照

Frame
UserControl
クイックスタート: ページ間のナビゲーション

 

 

表示:
© 2014 Microsoft. All rights reserved.