Marco Class
Representa un control de contenido que admite la navegación.
Herencia
Sintaxis
<Frame .../>
Atributos
- MarshalingBehaviorAttribute(Agile)
- StaticAttribute(Windows.UI.Xaml.Controls.IFrameStatics, NTDDI_WIN8)
- ThreadingAttribute(Both)
- VersionAttribute(NTDDI_WIN8)
- WebHostHiddenAttribute()
Miembros
El FrameClase tiene estos tipos de miembros:
Constructores
El FrameClase tiene estos constructores.
| Constructor | Descripción |
|---|---|
| Frame | Initializes a new instance of the Frame class. |
Eventos
El FrameClase tiene estos eventos.
| Evento | Descripción |
|---|---|
| DoubleTapped | Occurs when an otherwise unhandled DoubleTap interaction occurs over the hit test area of this element. (Heredado de UIElement) |
| DragEnter | Occurs when the input system reports an underlying drag event with this element as the target. (Heredado de UIElement) |
| DragLeave | Occurs when the input system reports an underlying drag event with this element as the origin. (Heredado de UIElement) |
| DragOver | Occurs when the input system reports an underlying drag event with this element as the potential drop target. (Heredado de UIElement) |
| Drop | Occurs when the input system reports an underlying drop event with this element as the drop target. (Heredado de UIElement) |
| GotFocus | Occurs when a UIElement receives focus. (Heredado de UIElement) |
| Holding | Occurs when an otherwise unhandled Hold interaction occurs over the hit test area of this element. (Heredado de UIElement) |
| IsEnabledChanged | Occurs when the IsEnabled property changes. (Heredado de Control) |
| KeyDown | Occurs when a keyboard key is pressed while the UIElement has focus. (Heredado de UIElement) |
| KeyUp | Occurs when a keyboard key is released while the UIElement has focus. (Heredado de UIElement) |
| LayoutUpdated | Occurs when the layout of the visual tree changes. (Heredado de FrameworkElement) |
| Loaded | Occurs when a FrameworkElement has been constructed and added to the object tree, and is ready for interaction. (Heredado de FrameworkElement) |
| LostFocus | Occurs when a UIElement loses focus. (Heredado de UIElement) |
| ManipulationCompleted | Occurs when a manipulation on the UIElement is complete. (Heredado de UIElement) |
| ManipulationDelta | Occurs when the input device changes position during a manipulation. (Heredado de UIElement) |
| ManipulationInertiaStarting | Occurs when the input device loses contact with the UIElement object during a manipulation and inertia begins. (Heredado de UIElement) |
| ManipulationStarted | Occurs when an input device begins a manipulation on the UIElement. (Heredado de UIElement) |
| ManipulationStarting | Occurs when the manipulation processor is first created. (Heredado de UIElement) |
| Navigated | Occurs when the content that is being navigated to has been found and is available from the Content property, although it may not have completed loading. |
| Navigating | Occurs when a new navigation is requested. |
| NavigationFailed | Occurs when an error is raised while navigating to the requested content. |
| NavigationStopped | Occurs when a new navigation is requested while a current navigation is in progress. |
| PointerCanceled | Occurs when a pointer that made contact abnormally loses contact. (Heredado de UIElement) |
| PointerCaptureLost | Occurs when pointer capture previously held by this element moves to another element or elsewhere. (Heredado de UIElement) |
| PointerEntered | Occurs when a pointer enters the hit test area of this element. (Heredado de UIElement) |
| PointerExited | Occurs when a pointer leaves the hit test area of this element. (Heredado de UIElement) |
| PointerMoved | Occurs when a pointer moves while the pointer remains within the hit test area of this element. (Heredado de UIElement) |
| PointerPressed | Occurs when the pointer device initiates a Press action within this element. (Heredado de UIElement) |
| PointerReleased | Occurs when the pointer device that previously initiated a Press action is released, while within this element. (Heredado de UIElement) |
| PointerWheelChanged | Occurs when the delta value of a pointer wheel changes. (Heredado de UIElement) |
| RightTapped | Occurs when a right-tap input stimulus happens while the pointer is over the element. (Heredado de UIElement) |
| SizeChanged | Occurs when either the ActualHeight or the ActualWidth property changes value on a FrameworkElement. (Heredado de FrameworkElement) |
| Tapped | Occurs when an otherwise unhandled Tap interaction occurs over the hit test area of this element. (Heredado de UIElement) |
| Unloaded | Occurs when this object is no longer connected to the main object tree. (Heredado de FrameworkElement) |
Métodos
The Frame Clase tiene estos métodos. También hereda métodos de Object Clase.
| Método | Descripción |
|---|---|
| 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. (Heredado de UIElement) |
| ApplyTemplate | Loads the relevant control template so that its parts can be referenced. (Heredado de 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. (Heredado de UIElement) |
| ArrangeOverride | Provides the behavior for the Arrange pass of layout. Classes can override this method to define their own Arrange pass behavior. (Heredado de FrameworkElement) |
| CapturePointer | Sets pointer capture to a UIElement. Once captured, only the element that has capture will fire pointer-related events. (Heredado de UIElement) |
| ClearValue | Clears the local value of a dependency property. (Heredado de DependencyObject) |
| FindName | Retrieves an object that has the specified identifier name. (Heredado de FrameworkElement) |
| FindSubElementsForTouchTargeting | Enables a UIElement subclass to expose child elements that assist with resolving touch targeting. (Heredado de UIElement) |
| Focus | Attempts to set the focus on the control. (Heredado de Control) |
| GetAnimationBaseValue | Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (Heredado de DependencyObject) |
| GetNavigationState | Serializes the Frame navigation history into a string. |
| GetTemplateChild | Retrieves the named element in the instantiated ControlTemplate visual tree. (Heredado de Control) |
| GetValue | Returns the current effective value of a dependency property from a DependencyObject. (Heredado de DependencyObject) |
| GoBack | Navigates to the most recent item in back navigation history, if a Frame manages its own navigation history. |
| GoForward | Navigates to the most recent item in forward navigation history, if a Frame manages its own navigation history. |
| InvalidateArrange | Invalidates the arrange state (layout) for a UIElement. After the invalidation, the UIElement will have its layout updated, which will occur asynchronously. (Heredado de UIElement) |
| InvalidateMeasure | Invalidates the measurement state (layout) for a UIElement. (Heredado de 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. (Heredado de 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. (Heredado de FrameworkElement) |
| Navigate(TypeName) | Causes the Frame to load content represented by the specified Page-derived data type. |
| Navigate(TypeName, Object) | Causes the Frame to load content represented by the specified Page-derived data type, also passing a parameter to be interpreted by the target of the navigation. |
| 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. (Heredado de FrameworkElement) |
| OnContentChanged | Invoked when the value of the Content property changes. (Heredado de ContentControl) |
| OnContentTemplateChanged | Invoked when the value of the ContentTemplate property changes. (Heredado de ContentControl) |
| OnContentTemplateSelectorChanged | Invoked when the value of the ContentTemplateSelector property changes. (Heredado de ContentControl) |
| OnCreateAutomationPeer | When implemented in a derived class, returns class-specific AutomationPeer implementations for the Microsoft UI Automation infrastructure. (Heredado de 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. (Heredado de UIElement) |
| OnDoubleTapped | Called before the DoubleTapped event occurs. (Heredado de Control) |
| OnDragEnter | Called before the DragEnter event occurs. (Heredado de Control) |
| OnDragLeave | Called before the DragLeave event occurs. (Heredado de Control) |
| OnDragOver | Called before the DragOver event occurs. (Heredado de Control) |
| OnDrop | Called before the Drop event occurs. (Heredado de Control) |
| OnGotFocus | Called before the GotFocus event occurs. (Heredado de Control) |
| OnHolding | Called before the Holding event occurs. (Heredado de Control) |
| OnKeyDown | Called before the KeyDown event occurs. (Heredado de Control) |
| OnKeyUp | Called before the KeyUp event occurs. (Heredado de Control) |
| OnLostFocus | Called before the LostFocus event occurs. (Heredado de Control) |
| OnManipulationCompleted | Called before the ManipulationCompleted event occurs. (Heredado de Control) |
| OnManipulationDelta | Called before the ManipulationDelta event occurs. (Heredado de Control) |
| OnManipulationInertiaStarting | Called before the ManipulationInertiaStarting event occurs. (Heredado de Control) |
| OnManipulationStarted | Called before the ManipulationStarted event occurs. (Heredado de Control) |
| OnManipulationStarting | Called before the ManipulationStarting event occurs. (Heredado de Control) |
| OnPointerCanceled | Called before the PointerCanceled event occurs. (Heredado de Control) |
| OnPointerCaptureLost | Called before the PointerCaptureLost event occurs. (Heredado de Control) |
| OnPointerEntered | Called before the PointerEntered event occurs. (Heredado de Control) |
| OnPointerExited | Called before the PointerExited event occurs. (Heredado de Control) |
| OnPointerMoved | Called before the PointerMoved event occurs. (Heredado de Control) |
| OnPointerPressed | Called before the PointerPressed event occurs. (Heredado de Control) |
| OnPointerReleased | Called before the PointerReleased event occurs. (Heredado de Control) |
| OnPointerWheelChanged | Called before the PointerWheelChanged event occurs. (Heredado de Control) |
| OnRightTapped | Called before the RightTapped event occurs. (Heredado de Control) |
| OnTapped | Called before the Tapped event occurs. (Heredado de Control) |
| ReadLocalValue | Returns the local value of a dependency property, if a local value is set. (Heredado de DependencyObject) |
| ReleasePointerCapture | Releases pointer captures for capture of one specific pointer by this UIElement. (Heredado de UIElement) |
| ReleasePointerCaptures | Releases all pointer captures held by this element. (Heredado de UIElement) |
| RemoveHandler | Removes the specified routed event handler from this UIElement. Typically the handler in question was added by AddHandler. (Heredado de UIElement) |
| SetBinding | Attaches a binding to a FrameworkElement, using the provided binding object. (Heredado de FrameworkElement) |
| SetNavigationState | Reads and restores the navigation history of a Frame from a provided serialization string. |
| SetValue | Sets the local value of a dependency property on a DependencyObject. (Heredado de DependencyObject) |
| TransformToVisual | Returns a transform object that can be used to transform coordinates from the UIElement to the specified object. (Heredado de UIElement) |
| UpdateLayout | Ensures that all positions of child objects of a UIElement are properly updated for layout. (Heredado de UIElement) |
Propiedades
El FrameClase tiene estas propiedades.
| Propiedad | Tipo de acceso | Descripción |
|---|---|---|
| Solo lectura | Gets the rendered height of a FrameworkElement. (Heredado de FrameworkElement) | |
| Solo lectura | Gets the rendered width of a FrameworkElement. (Heredado de FrameworkElement) | |
| Lectura y escritura | Gets or sets a value that determines whether this UIElement can be a drop target for purposes of drag-and-drop operations. (Heredado de UIElement) | |
| Lectura y escritura | Gets or sets a brush that provides the background of the control. (Heredado de Control) | |
| Solo lectura | Gets the number of entries in the navigation back stack. | |
| Solo lectura | Identifies the BackStackDepth dependency property. | |
| Solo lectura | 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. (Heredado de FrameworkElement) | |
| Lectura y escritura | Gets or sets a brush that describes the border background of a control. (Heredado de Control) | |
| Lectura y escritura | Gets or sets the border thickness of a control. (Heredado de Control) | |
| Lectura y escritura | Gets or sets a value that indicates that rendered content should be cached as a composited bitmap when possible. (Heredado de UIElement) | |
| Lectura y escritura | Gets or sets the number of pages in the navigation history that can be cached for the frame. | |
| Solo lectura | Identifies the CacheSize dependency property. | |
| Solo lectura | Gets a value that indicates whether there is at least one entry in back navigation history. | |
| Solo lectura | Identifies the CanGoBack dependency property. | |
| Solo lectura | Gets a value that indicates whether there is at least one entry in forward navigation history. | |
| Solo lectura | Identifies the CanGoForward dependency property. | |
| Lectura y escritura | Gets or sets the uniform spacing between characters, in units of 1/1000 of an em. (Heredado de Control) | |
| Lectura y escritura | Gets or sets the RectangleGeometry used to define the outline of the contents of a UIElement. (Heredado de UIElement) | |
| Lectura y escritura | Gets or sets the content of a ContentControl. (Heredado de ContentControl) | |
| Lectura y escritura | Gets or sets the data template that is used to display the content of the ContentControl. (Heredado de ContentControl) | |
| Lectura y escritura | Gets or sets a selection object that changes the DataTemplate to apply for content, based on processing information about the content item or its container at run time. (Heredado de ContentControl) | |
| Lectura y escritura | Gets or sets the collection of Transition style elements that apply to the content of a ContentControl. (Heredado de ContentControl) | |
| Solo lectura | Gets the data type of the content that is currently displayed. | |
| Solo lectura | Identifies the CurrentSourcePageType dependency property. | |
| Lectura y escritura | Gets or sets the data context for a FrameworkElement when it participates in data binding. (Heredado de FrameworkElement) | |
| Lectura y escritura | Gets or sets the key that references the default style for the control. (Heredado de Control) | |
| Solo lectura | Gets the size that this UIElement computed during the measure pass of the layout process. (Heredado de UIElement) | |
| Solo lectura | Gets the CoreDispatcher that this object is associated with. (Heredado de DependencyObject) | |
| Lectura y escritura | 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. (Heredado de FrameworkElement) | |
| Solo lectura | Gets a value that specifies whether this control has focus, and the mode by which focus was obtained. (Heredado de Control) | |
| Lectura y escritura | Gets or sets the font used to display text in the control. (Heredado de Control) | |
| Lectura y escritura | Gets or sets the size of the text in this control. (Heredado de Control) | |
| Lectura y escritura | Gets or sets the degree to which a font is condensed or expanded on the screen. (Heredado de Control) | |
| Lectura y escritura | Gets or sets the style in which the text is rendered. (Heredado de Control) | |
| Lectura y escritura | Gets or sets the thickness of the specified font. (Heredado de Control) | |
| Lectura y escritura | Gets or sets a brush that describes the foreground color. (Heredado de Control) | |
| Lectura y escritura | Gets or sets the suggested height of a FrameworkElement. (Heredado de FrameworkElement) | |
| Lectura y escritura | 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. (Heredado de FrameworkElement) | |
| Lectura y escritura | Gets or sets the horizontal alignment of the control's content. (Heredado de Control) | |
| Lectura y escritura | Gets or sets a value that determines whether the DoubleTapped event can originate from that element. (Heredado de UIElement) | |
| Lectura y escritura | Gets or sets a value indicating whether the user can interact with the control. (Heredado de Control) | |
| Lectura y escritura | Gets or sets whether the contained area of this UIElement can return true values for hit testing. (Heredado de UIElement) | |
| Lectura y escritura | Gets or sets a value that determines whether the Holding event can originate from that element. (Heredado de UIElement) | |
| Lectura y escritura | Gets or sets a value that determines whether the RightTapped event can originate from that element. (Heredado de UIElement) | |
| Lectura y escritura | Gets or sets a value that indicates whether a control is included in tab navigation. (Heredado de Control) | |
| Lectura y escritura | Gets or sets a value that determines whether the Tapped event can originate from that element. (Heredado de UIElement) | |
| Lectura y escritura | 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. (Heredado de FrameworkElement) | |
| Lectura y escritura | Gets or sets the ManipulationModes value used for UIElement behavior and interaction with gestures. (Heredado de UIElement) | |
| Lectura y escritura | Gets or sets the outer margin of a FrameworkElement. (Heredado de FrameworkElement) | |
| Lectura y escritura | Gets or sets the maximum height constraint of a FrameworkElement. (Heredado de FrameworkElement) | |
| Lectura y escritura | Gets or sets the maximum width constraint of a FrameworkElement. (Heredado de FrameworkElement) | |
| Lectura y escritura | Gets or sets the minimum height constraint of a FrameworkElement. (Heredado de FrameworkElement) | |
| Lectura y escritura | Gets or sets the minimum width constraint of a FrameworkElement. (Heredado de FrameworkElement) | |
| Lectura y escritura | 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. (Heredado de FrameworkElement) | |
| Lectura y escritura | Gets or sets the degree of the object's opacity. (Heredado de UIElement) | |
| Lectura y escritura | Gets or sets the padding inside a control. (Heredado de Control) | |
| Solo lectura | Gets the parent object of this FrameworkElement in the object tree. (Heredado de FrameworkElement) | |
| Solo lectura | Gets the set of all captured pointers, represented as Pointer values. (Heredado de UIElement) | |
| Lectura y escritura | Gets or sets the perspective projection (3-D effect) to apply when rendering this element. (Heredado de UIElement) | |
| Solo lectura | Gets the final render size of a UIElement. (Heredado de UIElement) | |
| Lectura y escritura | Gets or sets transform information that affects the rendering position of a UIElement. (Heredado de UIElement) | |
| Lectura y escritura | Gets or sets the origin point of any possible render transform declared by RenderTransform, relative to the bounds of the UIElement. (Heredado de UIElement) | |
| Lectura y escritura | 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. (Heredado de FrameworkElement) | |
| Lectura y escritura | Gets or sets the data type of the current content, or the content that should be navigated to. | |
| Solo lectura | Identifies the SourcePageType dependency property. | |
| Lectura y escritura | Gets or sets an instance Style that is applied for this object during layout and rendering. (Heredado de FrameworkElement) | |
| Lectura y escritura | 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. (Heredado de Control) | |
| Lectura y escritura | Gets or sets a value that modifies how tabbing and TabIndex work for this control. (Heredado de Control) | |
| Lectura y escritura | Gets or sets an arbitrary object value that can be used to store custom information about this object. (Heredado de FrameworkElement) | |
| Lectura y escritura | Gets or sets a control template. The control template defines the visual appearance of a control in UI, and is defined in XAML markup. (Heredado de Control) | |
| Lectura y escritura | Gets or sets the collection of Transition style elements that apply to a UIElement. (Heredado de UIElement) | |
| Solo lectura | Gets the collection of triggers for animations that are defined for a FrameworkElement. Not commonly used. (Heredado de FrameworkElement) | |
| Lectura y escritura | 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. (Heredado de UIElement) | |
| Lectura y escritura | 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. (Heredado de FrameworkElement) | |
| Lectura y escritura | Gets or sets the vertical alignment of the control's content. (Heredado de Control) | |
| Lectura y escritura | 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. (Heredado de UIElement) | |
| Lectura y escritura | Gets or sets the width of a FrameworkElement. (Heredado de FrameworkElement) |
Observaciones
Utilice el control Frame para admitir la navegación a los controles Page. Cree tantas páginas diferentes como necesite para presentar el contenido en su aplicación y, a continuación, navegue hasta esas páginas desde el marco. Para navegar desde el cuadro, llame al método Navigate y pase al tipo de página a la que va a navegar. También puede pasar un objeto de parámetro para inicializar la página en un estado determinado.
El marco admite la navegación de avance y retroceso en el historial navegación. La navegación de avance y retroceso permite a los usuarios navegar cómodamente entre páginas ya vistas y estados previamente vistos de una página. Utilice los métodos GoBack y GoForward para iniciar las solicitudes de navegación hacia atrás y hacia delante. Las propiedades CanGoBack y CanGoForward indican si una página está disponible en la dirección deseada. Una práctica frecuente es enlazar las propiedades IsEnabled de los botones de navegación a CanGoBack y CanGoForward de modo que los usuarios no puedan navegar a una página que no existe.
Muchas aplicaciones permiten a los usuarios navegar por las mismas páginas varias veces. Frame incluye una memoria caché de páginas para aumentar la eficacia. Establece la propiedad CacheSize para especificar cuántas páginas se conservan en la memoria caché. Cuando una página se almacena en la memoria caché, se reutiliza una instancia de la página con cada solicitud de navegación en lugar de volver a crear la página para cada solicitud.
Utilice la propiedad Page.NavigationCacheMode para especificar si reutilizar o volver a crear las instancias de los tipos concretos de la página cuando se vuelva a ellas varias veces.
Para almacenar en memoria caché una página, se debe establecer la propiedad Page.NavigationCacheMode en Enabled o en Required. Cuando la propiedad NavigationCacheMode de una página se establece en Required, la página se almacena en memoria caché independientemente del número de páginas almacenadas en caché especificadas en la propiedad CacheSize. Las páginas marcadas como Required no se tienen en cuenta para el valor de CacheSize total.
Ejemplos
El ejemplo de código siguiente muestra la invalidación del método OnLaunched generada para la plantilla en blanco de la aplicación en Microsoft Visual Studio. Este código muestra cómo el contenido de la ventana de la aplicación se establece en un nuevo objeto Frame, que después navega al objeto Page inicial predeterminado.
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(BlankPage)); // Place the frame in the current Window and ensure that it is active Window.Current.Content = rootFrame; Window.Current.Activate(); }
Requisitos
|
Cliente mínimo compatible | Windows 8 [Solo aplicaciones de la Tienda Windows] |
|---|---|
|
Servidor mínimo compatible | Windows Server 2012 [Solo aplicaciones de la Tienda Windows] |
|
Espacio de nombres |
|
|
Metadatos |
|
Consulta también
