Element Clase
Definición
Proporciona la clase base de todos los elementos jerárquicos de Xamarin.Forms.Provides the base class for all Xamarin.Forms hierarchal elements. Esta clase contiene todos los métodos y propiedades necesarios para representar un elemento en la jerarquía de Xamarin.Forms.This class contains all the methods and properties required to represent an element in the Xamarin.Forms hierarchy.
public abstract class Element : Xamarin.Forms.BindableObject, Xamarin.Forms.IElementController, Xamarin.Forms.Internals.INameScope
type Element = class
inherit BindableObject
interface INameScope
interface IElementController
- Herencia
- Derivado
- Implementaciones
Comentarios
En la tabla siguiente se indican las categorías importantes de elementos visuales:Important categories of visual elements are noted in the following table:
ClaseClass | DescripciónDescription |
---|---|
VisualElement | Element que ocupa una zona de la pantalla, tiene una apariencia visual y puede obtener la entrada táctil.A Element that occupies an area on the screen, has a visual appearance, and can obtain touch input. |
Cell | Las celdas son elementos diseñados para agregarse a ListView o TableView.Cells are elements meant to be added to ListView or TableView. |
Page | VisualElementQue ocupa la mayoría o la totalidad de la pantalla y contiene un único elemento secundario.A VisualElement that occupies most or all of the screen and contains a single child. |
Layout | Layouttener un único elemento secundario de tipo View , mientras que las subclases de Xamarin.Forms.Layout\`1 tienen una colección de varias vistas de elementos secundarios, incluidos otros diseños. Layout have a single child of type View, while subclasses of Xamarin.Forms.Layout\`1 have a collection of multiple children views, including other layouts. |
Controles y View s especializadasControls and specialized Views | En la parte inferior del diagrama se muestran las clases de Xamarin. Forms para controles disponibles universalmente, como Button s y TableView s.The lower part of the diagram shows the Xamarin.Forms classes for universally-available controls, such as Buttons and TableViews. |
Constructores
Element() |
Constructor protegido usado para inicializar el elemento.Protected constructor used to initialize a the element. |
Campos
AutomationIdProperty |
Memoria auxiliar del campo AutomationId.The backing store for the AutomationId field. |
ClassIdProperty |
Identifica la propiedad enlazable ClassId.Identifies the ClassId bindable property. |
MenuProperty |
Memoria auxiliar de la propiedad de menú adjunta.Backing store for the attached menu property. |
Propiedades
AutomationId |
Obtiene o establece un valor que permite que el marco de automatización busque este elemento e interactúe con él.Gets or sets a value that allows the automation framework to find and interact with this element. |
BindingContext |
Obtiene o establece el objeto que contiene las propiedades que van a dirigir las propiedades enlazadas que pertenecen a este BindableObject.Gets or sets object that contains the properties that will be targeted by the bound properties that belong to this BindableObject. (Heredado de BindableObject) |
ClassId |
Obtiene o establece un valor que se usa para identificar una colección de elementos similares semánticamente.Gets or sets a value used to identify a collection of semantically similar elements. |
Dispatcher | (Heredado de BindableObject) |
EffectControlProvider |
Para uso interno de la plataforma de Xamarin.Forms.For internal use by the Xamarin.Forms platform. |
Effects |
Lista de los efectos aplicados a este elemento.A list of the effects that are applied to this item. |
Id |
Obtiene un valor que se puede utilizar para identificar de forma única un elemento durante la ejecución de una aplicación.Gets a value that can be used to uniquely identify an element through the run of an application. |
LogicalChildren |
Para uso interno de la plataforma de Xamarin.Forms.For internal use by the Xamarin.Forms platform. |
Parent |
Obtiene o establece el elemento principal del elemento.Gets or sets the parent element of the element. |
ParentView |
Obsoleto.
Obtiene el elemento que es el antecesor más cercano de este elemento, que es un VisualElement.Gets the element which is the closest ancestor of this element that is a VisualElement. |
Platform | |
RealParent |
Para uso interno de la plataforma de Xamarin.Forms.For internal use by the Xamarin.Forms platform. |
StyleId |
Obtiene o establece un valor definido por el usuario que identifica de forma única el elemento.Gets or sets a user defined value to uniquely identify the element. |
Métodos
ApplyBindings() |
Aplica los enlaces a BindingContext.Apply the bindings to BindingContext. (Heredado de BindableObject) |
ClearValue(BindableProperty) |
Borra cualquier valor establecido por SetValue para |
ClearValue(BindablePropertyKey) |
Borra cualquier valor establecido por SetValue para la propiedad que |
CoerceValue(BindableProperty) | (Heredado de BindableObject) |
CoerceValue(BindablePropertyKey) | (Heredado de BindableObject) |
Descendants() |
Para uso interno de la plataforma de Xamarin.Forms.For internal use by the Xamarin.Forms platform. |
EffectIsAttached(String) |
Para uso interno de la plataforma de Xamarin.Forms.For internal use by the Xamarin.Forms platform. |
FindByName(String) |
Recupera el elemento que tiene el nombre especificado.Returns the element that has the specified name. |
GetMenu(BindableObject) |
Obtiene el objeto Menu de |
GetValue(BindableProperty) |
Devuelve el valor contenido en la propiedad BindableProperty.Returns the value that is contained in the BindableProperty. (Heredado de BindableObject) |
GetValues(BindableProperty, BindableProperty) |
Obsoleto.
Para uso interno de la plataforma de Xamarin.Forms.For internal use by the Xamarin.Forms platform. (Heredado de BindableObject) |
GetValues(BindableProperty, BindableProperty, BindableProperty) |
Obsoleto.
Para uso interno de la plataforma de Xamarin.Forms.For internal use by the Xamarin.Forms platform. (Heredado de BindableObject) |
IsSet(BindableProperty) |
Devuelve |
OnBindingContextChanged() |
Se invoca siempre que el contexto de enlace del elemento cambia.Invoked whenever the binding context of the element changes. Implemente este método a fin de agregar el control de clases para este evento.Implement this method to add class handling for this event. |
OnChildAdded(Element) |
Se invoca siempre que el evento ChildAdded debe emitirse.Invoked whenever the ChildAdded event needs to be emitted. Implemente este método a fin de agregar el control de clases para este evento.Implement this method to add class handling for this event. |
OnChildRemoved(Element) |
Obsoleto.
Se invoca siempre que el evento ChildRemoved debe emitirse.Invoked whenever the ChildRemoved event needs to be emitted. Implemente este método a fin de agregar el control de clases para este evento.Implement this method to add class handling for this event. |
OnChildRemoved(Element, Int32) | |
OnParentSet() |
Se invoca cuando se establece el elemento primario de un elemento.Invoked whenever the Parent of an element is set. Implemente este método para agregar comportamiento cuando el elemento se agrega a un elemento primario.Implement this method in order to add behavior when the element is added to a parent. |
OnPropertyChanged(String) |
Método al que se llama cuando una propiedad enlazada cambia.Method that is called when a bound property is changed. |
OnPropertyChanging(String) |
Llama a este método desde una clase secundaria para notificar que se va a producir un cambio en una propiedad.Call this method from a child class to notify that a change is going to happen on a property. (Heredado de BindableObject) |
RemoveBinding(BindableProperty) |
Quita un enlace definida previamente.Removes a previously set binding. (Heredado de BindableObject) |
RemoveDynamicResource(BindableProperty) |
Quita un recurso dinámico definido previamente.Removes a previously set dynamic resource |
SetBinding(BindableProperty, BindingBase) |
Asigna un enlace a una propiedad.Assigns a binding to a property. (Heredado de BindableObject) |
SetDynamicResource(BindableProperty, String) |
Establece que la propiedad BindableProperty de este elemento se actualice a través del DynamicResource con la clave proporcionada.Sets the BindableProperty property of this element to be updated via the DynamicResource with the provided key. |
SetMenu(BindableObject, Menu) |
Establece el menú de |
SetValue(BindableProperty, Object) |
Establece el valor de la propiedad especificada.Sets the value of the specified property. (Heredado de BindableObject) |
SetValue(BindablePropertyKey, Object) |
Establece el valor de la propiedad propertyKey.Sets the value of the propertyKey. (Heredado de BindableObject) |
SetValueCore(BindableProperty, Object, SetValueFlags) |
Para uso interno de la plataforma de Xamarin.Forms.For internal use by the Xamarin.Forms platform. (Heredado de BindableObject) |
SetValueFromRenderer(BindableProperty, Object) |
Para uso interno de la plataforma de Xamarin.Forms.For internal use by the Xamarin.Forms platform. |
SetValueFromRenderer(BindablePropertyKey, Object) |
Para uso interno de la plataforma de Xamarin.Forms.For internal use by the Xamarin.Forms platform. |
UnapplyBindings() |
Deshace todos los enlaces establecidos previamente.Unapplies all previously set bindings. (Heredado de BindableObject) |
Eventos
BindingContextChanged |
Se produce siempre que cambia la propiedad BindingContext.Raised whenever the BindingContext property changes. (Heredado de BindableObject) |
ChildAdded |
Se produce cada vez que se agrega un elemento secundario al elemento.Occurs whenever a child element is added to the element. |
ChildRemoved |
Se produce cada vez que se quita un elemento secundario del elemento.Occurs whenever a child element is removed from the element. |
DescendantAdded |
Se produce cada vez que se agrega un elemento secundario al subárbol de elementos.Occurs whenever a child element is added to the elements subtree. |
DescendantRemoved |
Se produce cada vez que se quita un elemento secundario del subárbol de elementos.Occurs whenever a child element is removed from the elements subtree. |
PlatformSet | |
PropertyChanged |
Se produce cuando ha cambiado una propiedad.Raised when a property has changed. (Heredado de BindableObject) |
PropertyChanging |
Se produce cuando una propiedad está a punto de cambiar.Raised when a property is about to change. (Heredado de BindableObject) |
Implementaciones de interfaz explícitas
IDynamicResourceHandler.SetDynamicResource(BindableProperty, String) |
Para uso interno de la plataforma de Xamarin.Forms.For internal use by the Xamarin.Forms platform. (Heredado de BindableObject) |
IElementController.SetValueFromRenderer(BindableProperty, Object) |
Para uso interno de la plataforma de Xamarin.Forms.For internal use by the Xamarin.Forms platform. |
INameScope.RegisterName(String, Object) |
Sólo para uso interno.For internal use only. |
Métodos de extensión
GetPropertyIfSet<T>(BindableObject, BindableProperty, T) | |
SetAppThemeColor(BindableObject, BindableProperty, Color, Color) | |
SetBinding(BindableObject, BindableProperty, String, BindingMode, IValueConverter, String) |
Crea y aplica un enlace a una propiedad.Creates and applies a binding to a property. |
SetBinding<TSource>(BindableObject, BindableProperty, Expression<Func<TSource,Object>>, BindingMode, IValueConverter, String) |
Obsoleto.
Crea y aplica un enlace desde una expresión.Creates and applies a binding from an expression. |
SetOnAppTheme<T>(BindableObject, BindableProperty, T, T) | |
FindByName<T>(Element, String) |
Devuelve la instancia del tipo |