Développer Réduire

UIElement Class

UIElement est une classe de base pour la plupart des objets qui ont l'apparence visuelle et peut traiter l'entrée de base dans une interface utilisateur.

Héritage

Object
  DependencyObject
    UIElement

Syntaxe


public class UIElement : DependencyObject

Attributs

MarshalingBehaviorAttribute(Agile)
StaticAttribute(Windows.UI.Xaml.IUIElementStatics, NTDDI_WIN8)
ThreadingAttribute(Both)
VersionAttribute(NTDDI_WIN8)
WebHostHiddenAttribute()

Membres

UIElementClasse comporte les types de membres suivants :

Événements

UIElementClasse comporte les événements suivants.

ÉvénementDescription
DoubleTapped Occurs when an otherwise unhandled DoubleTap interaction occurs over the hit test area of this element.
DragEnter Occurs when the input system reports an underlying drag event with this element as the target.
DragLeave Occurs when the input system reports an underlying drag event with this element as the origin.
DragOver Occurs when the input system reports an underlying drag event with this element as the potential drop target.
Drop Occurs when the input system reports an underlying drop event with this element as the drop target.
GotFocus Occurs when a UIElement receives focus.
Holding Occurs when an otherwise unhandled Hold interaction occurs over the hit test area of this element.
KeyDown Occurs when a keyboard key is pressed while the UIElement has focus.
KeyUp Occurs when a keyboard key is released while the UIElement has focus.
LostFocus Occurs when a UIElement loses focus.
ManipulationCompleted Occurs when a manipulation on the UIElement is complete.
ManipulationDelta Occurs when the input device changes position during a manipulation.
ManipulationInertiaStarting Occurs when the input device loses contact with the UIElement object during a manipulation and inertia begins.
ManipulationStarted Occurs when an input device begins a manipulation on the UIElement.
ManipulationStarting Occurs when the manipulation processor is first created.
PointerCanceled Occurs when a pointer that made contact abnormally loses contact.
PointerCaptureLost Occurs when pointer capture previously held by this element moves to another element or elsewhere.
PointerEntered Occurs when a pointer enters the hit test area of this element.
PointerExited Occurs when a pointer leaves the hit test area of this element.
PointerMoved Occurs when a pointer moves while the pointer remains within the hit test area of this element.
PointerPressed Occurs when the pointer device initiates a Press action within this element.
PointerReleased Occurs when the pointer device that previously initiated a Press action is released, while within this element.
PointerWheelChanged Occurs when the delta value of a pointer wheel changes.
RightTapped Occurs when a right-tap input stimulus happens while the pointer is over the element.
Tapped Occurs when an otherwise unhandled Tap interaction occurs over the hit test area of this element.

 

Méthodes

The UIElement Classe comporte les méthodes suivantes. Il hérite également des méthodes de Object Classe.

MéthodeDescription
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.
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.
CapturePointer Sets pointer capture to a UIElement. Once captured, only the element that has capture will fire pointer-related events.
ClearValue Clears the local value of a dependency property. (Hérité de DependencyObject)
FindSubElementsForTouchTargeting Enables a UIElement subclass to expose child elements that assist with resolving touch targeting.
GetAnimationBaseValue Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (Hérité de DependencyObject)
GetValue Returns the current effective value of a dependency property from a DependencyObject. (Hérité de DependencyObject)
InvalidateArrange Invalidates the arrange state (layout) for a UIElement. After the invalidation, the UIElement will have its layout updated, which will occur asynchronously.
InvalidateMeasure Invalidates the measurement state (layout) for a 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.
OnCreateAutomationPeer When implemented in a derived class, returns class-specific AutomationPeer implementations for the Microsoft UI Automation infrastructure.
OnDisconnectVisualChildren Override this method to implement how layout and logic should behave when items are removed from a class-specific content or children property.
ReadLocalValue Returns the local value of a dependency property, if a local value is set. (Hérité de DependencyObject)
ReleasePointerCapture Releases pointer captures for capture of one specific pointer by this UIElement.
ReleasePointerCaptures Releases all pointer captures held by this element.
RemoveHandler Removes the specified routed event handler from this UIElement. Typically the handler in question was added by AddHandler.
SetValue Sets the local value of a dependency property on a DependencyObject. (Hérité de DependencyObject)
TransformToVisual Returns a transform object that can be used to transform coordinates from the UIElement to the specified object.
UpdateLayout Ensures that all positions of child objects of a UIElement are properly updated for layout.

 

Propriétés

Le UIElementClasse contient les propriétés suivantes.

PropriétéType d’accèsDescription

AllowDrop

en lecture/écritureGets or sets a value that determines whether this UIElement can be a drop target for purposes of drag-and-drop operations.

AllowDropProperty

en lecture seuleIdentifies the AllowDrop dependency property.

CacheMode

en lecture/écritureGets or sets a value that indicates that rendered content should be cached as a composited bitmap when possible.

CacheModeProperty

en lecture seuleIdentifies the CacheMode dependency property.

Clip

en lecture/écritureGets or sets the RectangleGeometry used to define the outline of the contents of a UIElement.

ClipProperty

en lecture seuleIdentifies the Clip dependency property.

DesiredSize

en lecture seuleGets the size that this UIElement computed during the measure pass of the layout process.

Dispatcher

en lecture seuleGets the CoreDispatcher that this object is associated with. (Hérité de DependencyObject)

DoubleTappedEvent

en lecture seuleGets the identifier for the DoubleTapped routed event.

DragEnterEvent

en lecture seuleGets the identifier for the DragEnter routed event.

DragLeaveEvent

en lecture seuleGets the identifier for the DragLeave routed event.

DragOverEvent

en lecture seuleGets the identifier for the DragOver routed event.

DropEvent

en lecture seuleGets the identifier for the Drop routed event.

HoldingEvent

en lecture seuleGets the identifier for the Holding routed event.

IsDoubleTapEnabled

en lecture/écritureGets or sets a value that determines whether the DoubleTapped event can originate from that element.

IsDoubleTapEnabledProperty

en lecture seuleIdentifies the IsDoubleTapEnabled dependency property.

IsHitTestVisible

en lecture/écritureGets or sets whether the contained area of this UIElement can return true values for hit testing.

IsHitTestVisibleProperty

en lecture seuleIdentifies the IsHitTestVisible dependency property.

IsHoldingEnabled

en lecture/écritureGets or sets a value that determines whether the Holding event can originate from that element.

IsHoldingEnabledProperty

en lecture seuleIdentifies the IsHoldingEnabled dependency property.

IsRightTapEnabled

en lecture/écritureGets or sets a value that determines whether the RightTapped event can originate from that element.

IsRightTapEnabledProperty

en lecture seuleIdentifies the IsRightTapEnabled dependency property.

IsTapEnabled

en lecture/écritureGets or sets a value that determines whether the Tapped event can originate from that element.

IsTapEnabledProperty

en lecture seuleIdentifies the IsTapEnabled dependency property.

KeyDownEvent

en lecture seuleGets the identifier for the KeyDown routed event.

KeyUpEvent

en lecture seuleGets the identifier for the KeyUp routed event.

ManipulationCompletedEvent

en lecture seuleGets the identifier for the ManipulationCompleted routed event.

ManipulationDeltaEvent

en lecture seuleGets the identifier for the ManipulationDelta routed event.

ManipulationInertiaStartingEvent

en lecture seuleGets the identifier for the ManipulationInertiaStarting routed event.

ManipulationMode

en lecture/écritureGets or sets the ManipulationModes value used for UIElement behavior and interaction with gestures.

ManipulationModeProperty

en lecture seuleIdentifies the ManipulationMode dependency property.

ManipulationStartedEvent

en lecture seuleGets the identifier for the ManipulationStarted routed event.

ManipulationStartingEvent

en lecture seuleGets the identifier for the ManipulationStarting routed event.

Opacity

en lecture/écritureGets or sets the degree of the object's opacity.

OpacityProperty

en lecture seuleIdentifies the IsHitTestVisible dependency property.

PointerCanceledEvent

en lecture seuleGets the identifier for the PointerCanceled routed event.

PointerCaptureLostEvent

en lecture seuleGets the identifier for the PointerCaptureLost routed event.

PointerCaptures

en lecture seuleGets the set of all captured pointers, represented as Pointer values.

PointerCapturesProperty

en lecture seuleIdentifies the PointerCaptures dependency property.

PointerEnteredEvent

en lecture seuleGets the identifier for the PointerEntered routed event.

PointerExitedEvent

en lecture seuleGets the identifier for the PointerExited routed event.

PointerMovedEvent

en lecture seuleGets the identifier for the PointerMoved routed event.

PointerPressedEvent

en lecture seuleGets the identifier for the PointerPressed routed event.

PointerReleasedEvent

en lecture seuleGets the identifier for the PointerReleased routed event.

PointerWheelChangedEvent

en lecture seuleGets the identifier for the PointerWheelChanged routed event.

Projection

en lecture/écritureGets or sets the perspective projection (3-D effect) to apply when rendering this element.

ProjectionProperty

en lecture seuleIdentifies the Projection dependency property.

RenderSize

en lecture seuleGets the final render size of a UIElement.

RenderTransform

en lecture/écritureGets or sets transform information that affects the rendering position of a UIElement.

RenderTransformOrigin

en lecture/écritureGets or sets the origin point of any possible render transform declared by RenderTransform, relative to the bounds of the UIElement.

RenderTransformOriginProperty

en lecture seuleIdentifies the RenderTransformOrigin dependency property.

RenderTransformProperty

en lecture seuleIdentifies the RenderTransform dependency property.

RightTappedEvent

en lecture seuleGets the identifier for the RightTapped routed event.

TappedEvent

en lecture seuleGets the identifier for the Tapped routed event.

Transitions

en lecture/écritureGets or sets the collection of Transition style elements that apply to a UIElement.

TransitionsProperty

en lecture seuleIdentifies the Transitions dependency property.

UseLayoutRounding

en lecture/écritureGets 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.

UseLayoutRoundingProperty

en lecture seuleIdentifies the UseLayoutRounding dependency property.

Visibility

en lecture/écritureGets 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.

VisibilityProperty

en lecture seuleIdentifies the Visibility dependency property.

 

Remarques

UIElement fournit un point de départ pour les caractéristiques de disposition. FrameworkElement ajoute d'autres fonctionnalités de présentation.

La majeure partie du comportement d'entrée des éléments visibles dans une interface utilisateur est définie dans la classe UIElement. Cela inclut les événements pour clavier, pointeurs, fonctions tactiles, manipulations et événements de focus. Certains de ces événements sont des événements routés. Un événement routé active un système intégré de notification de la gestion des événements, afin qu'un objet parent puisse gérer les événements d'entrée des objets enfants dans l'arborescence des objets si l'événement demeure non géré. Ce comportement des événements d'entrée est utile pour le regroupement des zones d'entrée et pour la composition de contrôle. Pour plus d'informations, consultez Vue d'ensemble des événements et des événements routés.

UIElement possède des propriétés qui peuvent influencer les préférences des éléments pour traiter l'entrée. Par exemple, vous pouvez permettre à l'élément d'être une cible de déplacement avec AllowDrop, ou désactiver la réponse par frappe avec IsTapEnabled.

Même si UIElement définisse les événements pour la création de rapports de focus (GotFocus, LostFocus), UIElement ne définit pas d'API pour la définition par programme du focus. Cette fonctionnalité est définie par la classe Control.

UIElement n'expose pas de constructeur public. En général, vous ne dérivez pas des classes provenant de UIElement ou de FrameworkElement directement. Les classes de base les plus fréquemment utilisées pour les classes personnalisées dérivées sont les classes suivantes :

Configuration requise

Client minimal pris en charge

Windows 8 [Applications du Windows Store uniquement]

Serveur minimal pris en charge

Windows Server 2012 [Applications du Windows Store uniquement]

Espace de noms

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

Métadonnées

Windows.winmd

Voir aussi

DependencyObject

 

 

Afficher:
© 2014 Microsoft