Class UIElement
UIElement is a base class for most of the objects that have visual appearance and can process basic input in a user interface.
Inherited Members
Namespace: System.Windows
Assembly: OpenSilver.dll
Syntax
public abstract class UIElement : DependencyObject, IUIElement, IDependencyObject
Constructors
| Improve this Doc View SourceUIElement()
Declaration
public UIElement()
Fields
| Improve this Doc View SourceAllowDropProperty
Identifies the AllowDrop dependency property.
Declaration
public static readonly DependencyProperty AllowDropProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
AllowScrollOnTouchMoveProperty
Identifies the AllowScrollOnTouchMove dependency property.
Declaration
public static readonly DependencyProperty AllowScrollOnTouchMoveProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
CacheModeProperty
Identifies the CacheMode dependency property.
Declaration
[NotImplemented]
public static readonly DependencyProperty CacheModeProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty | The identifier for the CacheMode dependency property. |
ClipProperty
Identifies the Clip dependency property.
Declaration
public static readonly DependencyProperty ClipProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
ClipToBoundsProperty
Identifies the ClipToBounds dependency property.
Declaration
public static readonly DependencyProperty ClipToBoundsProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
EffectProperty
Identifies the Effect dependency property.
Declaration
public static readonly DependencyProperty EffectProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
GotFocusEvent
Declaration
public static readonly RoutedEvent GotFocusEvent
Field Value
| Type | Description |
|---|---|
| RoutedEvent |
IsEnabledProperty
Identifies the IsEnabled dependency property.
Declaration
public static readonly DependencyProperty IsEnabledProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
IsHitTestVisibleProperty
Identifies the IsHitTestVisible dependency property.
Declaration
public static readonly DependencyProperty IsHitTestVisibleProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
IsVisibleProperty
Identifies the IsVisible dependency property.
Declaration
public static readonly DependencyProperty IsVisibleProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
KeyDownEvent
Declaration
public static readonly RoutedEvent KeyDownEvent
Field Value
| Type | Description |
|---|---|
| RoutedEvent |
KeyUpEvent
Declaration
public static readonly RoutedEvent KeyUpEvent
Field Value
| Type | Description |
|---|---|
| RoutedEvent |
LostFocusEvent
Declaration
public static readonly RoutedEvent LostFocusEvent
Field Value
| Type | Description |
|---|---|
| RoutedEvent |
MouseEnterEvent
Declaration
public static readonly RoutedEvent MouseEnterEvent
Field Value
| Type | Description |
|---|---|
| RoutedEvent |
MouseLeaveEvent
Declaration
public static readonly RoutedEvent MouseLeaveEvent
Field Value
| Type | Description |
|---|---|
| RoutedEvent |
MouseLeftButtonDownEvent
Declaration
public static readonly RoutedEvent MouseLeftButtonDownEvent
Field Value
| Type | Description |
|---|---|
| RoutedEvent |
MouseLeftButtonUpEvent
Declaration
public static readonly RoutedEvent MouseLeftButtonUpEvent
Field Value
| Type | Description |
|---|---|
| RoutedEvent |
MouseMoveEvent
Declaration
public static readonly RoutedEvent MouseMoveEvent
Field Value
| Type | Description |
|---|---|
| RoutedEvent |
MouseRightButtonDownEvent
Identifies the MouseRightButtonDown routed event.
Declaration
public static readonly RoutedEvent MouseRightButtonDownEvent
Field Value
| Type | Description |
|---|---|
| RoutedEvent |
MouseRightButtonUpEvent
Declaration
public static readonly RoutedEvent MouseRightButtonUpEvent
Field Value
| Type | Description |
|---|---|
| RoutedEvent |
MouseWheelEvent
Identifies the MouseWheel routed event.
Declaration
public static readonly RoutedEvent MouseWheelEvent
Field Value
| Type | Description |
|---|---|
| RoutedEvent |
OpacityMaskProperty
Identifies the OpacityMask dependency property.
Declaration
public static readonly DependencyProperty OpacityMaskProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
OpacityProperty
Identifies the Opacity dependency property.
Declaration
public static readonly DependencyProperty OpacityProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
ProjectionProperty
Declaration
[NotImplemented]
public static readonly DependencyProperty ProjectionProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
RenderTransformOriginProperty
Identifies the RenderTransformOrigin dependency property.
Declaration
public static readonly DependencyProperty RenderTransformOriginProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
RenderTransformProperty
Identifies the RenderTransform dependency property.
Declaration
public static readonly DependencyProperty RenderTransformProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
TappedEvent
Declaration
public static readonly RoutedEvent TappedEvent
Field Value
| Type | Description |
|---|---|
| RoutedEvent |
TextInputEvent
Identifies the TextInput routed event.
Declaration
public static readonly RoutedEvent TextInputEvent
Field Value
| Type | Description |
|---|---|
| RoutedEvent |
TextInputStartEvent
Identifies the TextInputStart routed event.
Declaration
public static readonly RoutedEvent TextInputStartEvent
Field Value
| Type | Description |
|---|---|
| RoutedEvent |
TextInputUpdateEvent
Identifies the TextInputUpdate routed event.
Declaration
[NotImplemented]
public static readonly RoutedEvent TextInputUpdateEvent
Field Value
| Type | Description |
|---|---|
| RoutedEvent |
UseLayoutRoundingProperty
Identifies the UseLayoutRounding dependency property.
Declaration
public static readonly DependencyProperty UseLayoutRoundingProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
VisibilityProperty
Identifies the Visibility dependency property.
Declaration
public static readonly DependencyProperty VisibilityProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
XamlSourcePath
Declaration
public string XamlSourcePath
Field Value
| Type | Description |
|---|---|
| System.String |
Properties
| Improve this Doc View SourceAllowDrop
Gets or sets a value that determines whether this UIElement can be a drop target for purposes of drag-and-drop operations.
Declaration
public bool AllowDrop { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
AllowScrollOnTouchMove
Gets or sets whether pressing (touchscreen devices) on this UIElement then moving should allow scrolling or not. The default value is True.
Declaration
public bool AllowScrollOnTouchMove { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
CacheMode
Gets or sets a value that indicates that rendered content should be cached when possible.
Declaration
[NotImplemented]
public CacheMode CacheMode { get; set; }
Property Value
| Type | Description |
|---|---|
| CacheMode | A value that indicates that rendered content should be cached when possible. If you specify a value of CacheMode, rendering operations from RenderTransform and Opacity execute on the graphics processing unit (GPU), if available. The default is null, which does not enable a cached composition mode. |
Clip
Declaration
public Geometry Clip { get; set; }
Property Value
| Type | Description |
|---|---|
| Geometry | The geometry to be used for clipping area sizing. The default value is null. |
ClipToBounds
Gets or sets a value indicating whether to clip the content of this element (or content coming from the child elements of this element) to fit into the size of the containing element. This is a dependency property.
Declaration
public bool ClipToBounds { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
DesiredSize
Gets the size that this UIElement computed during the measure pass of the layout process.
Declaration
public Size DesiredSize { get; }
Property Value
| Type | Description |
|---|---|
| Size | The size that this UIElement computed during the measure pass of the layout process. |
Effect
Gets or sets the pixel shader effect to use for rendering this UIElement.
Declaration
public Effect Effect { get; set; }
Property Value
| Type | Description |
|---|---|
| Effect | The pixel shader effect to use for rendering this UIElement. The default is null (no effects). |
IsEnabled
Gets or sets a value indicating whether the user can interact with the control.
Declaration
public bool IsEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true if the user can interact with the control; otherwise, false. |
IsHitTestVisible
Gets or sets whether the contained area of this UIElement can return true values for hit testing.
Declaration
public bool IsHitTestVisible { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsMouseCaptured
Gets a value indicating whether the pointer is captured to this element.
Declaration
public bool IsMouseCaptured { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsVisible
Gets a value indicating whether this element is visible in the user interface (UI). This is a dependency property.
Declaration
public bool IsVisible { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true if the element is visible; otherwise, false. |
Opacity
Gets or sets the degree of the object's opacity.
Declaration
public double Opacity { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | A value between 0 and 1.0 that declares the opacity factor, with 1.0 meaning full opacity and 0 meaning transparent. The default value is 1.0. |
OpacityMask
Gets or sets the brush used to alter the opacity of regions of this object.
Declaration
public Brush OpacityMask { get; set; }
Property Value
| Type | Description |
|---|---|
| Brush | A brush that describes the opacity applied to this object. The default is null. |
Projection
Declaration
[NotImplemented]
public Projection Projection { get; set; }
Property Value
| Type | Description |
|---|---|
| Projection |
RenderSize
Gets the final render size of a UIElement.
Declaration
public Size RenderSize { get; }
Property Value
| Type | Description |
|---|---|
| Size | The rendered size for this object. There is no default value. |
RenderTransform
Gets or sets transform information that affects the rendering position of a UIElement.
Declaration
public Transform RenderTransform { get; set; }
Property Value
| Type | Description |
|---|---|
| Transform | Describes the specifics of the desired render transform. The default value is null. |
RenderTransformOrigin
Gets or sets the origin point of any possible render transform declared by RenderTransform, relative to the bounds of the UIElement.
Declaration
public Point RenderTransformOrigin { get; set; }
Property Value
| Type | Description |
|---|---|
| Point | The origin point of the render transform. The default value is a point with value 0,0. |
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.
Declaration
public bool UseLayoutRounding { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
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.
Declaration
public Visibility Visibility { get; set; }
Property Value
| Type | Description |
|---|---|
| Visibility |
VisualChildrenCount
Gets the number of child elements for the UIElement.
Declaration
protected virtual int VisualChildrenCount { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The number of child elements. |
VisualParent
Gets the visual tree parent of the visual object.
Declaration
protected DependencyObject VisualParent { get; }
Property Value
| Type | Description |
|---|---|
| DependencyObject | The UIElement parent. |
Methods
| Improve this Doc View SourceAddHandler(RoutedEvent, Delegate, Boolean)
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 for routed event that had already been marked as handled by another element along the event route.
Declaration
public void AddHandler(RoutedEvent routedEvent, Delegate handler, bool handledEventsToo)
Parameters
| Type | Name | Description |
|---|---|---|
| RoutedEvent | routedEvent | An identifier for the routed event to be handled. |
| System.Delegate | handler | A reference to the handler implementation. |
| System.Boolean | handledEventsToo | true to register the handler such that it is invoked even when the routed event is marked handled in its event data; false to register the handler with the default condition that it will not be invoked if the routed event is already marked handled. The default is false. Do not routinely ask to rehandle a routed event. For more information, see Remarks. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | routedEvent or handler is null. |
| System.ArgumentException | routedEvent does not represent a supported routed event.-or-handler does not implement a supported delegate. |
| System.NotImplementedException | Attempted to add handler for an event not supported by the current platform variation. |
AddVisualChild(UIElement)
Defines the parent-child relationship between two visuals.
Declaration
protected void AddVisualChild(UIElement child)
Parameters
| Type | Name | Description |
|---|---|---|
| UIElement | child | The child visual object to add to parent visual. |
Arrange(Rect)
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.
Declaration
public void Arrange(Rect finalRect)
Parameters
| Type | Name | Description |
|---|---|---|
| Rect | finalRect | The final size that the parent computes for the child in layout, provided as a Rect value. |
Remarks
There is no reason to call Measure(Size) or Arrange(Rect) outside of the context of overriding methods that perform custom layout actions. Silverlight layout works autonomously, based on detecting changes to the object tree and layout-relevant properties at run time. The finalRect you pass to Measure(Size) cannot have a System.Double.NaN value for any Rect value. Also, finalRect cannot have any infinite values for any Rect value. Typically, calls to Arrange(Rect) will incorporate a finalRect that uses the height and width values from DesiredSize for each element . Exceptions to this typical behavior might be necessary if an element holds a DesiredSize that the layout parent cannot accommodate, or if the sum total of all child element DesiredSize values cannot be accommodated or arranged. In such cases the child element content might be clipped, resized, or placed in a scroll region, which all depends on the specific functionality that is enabled in the layout parent container.
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | finalRect contained a System.Double.NaN or infinite value. See Remarks. |
CaptureMouse()
Sets pointer capture to a UIElement.
Declaration
public bool CaptureMouse()
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the object has pointer capture; otherwise, false. |
CreateDomElement(Object, out Object)
When overriden, creates the dom elements designed to represent an instance of an UIElement and defines the place where its child(ren) will be added.
Declaration
public abstract object CreateDomElement(object parentRef, out object domElementWhereToPlaceChildren)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | parentRef | The parent of the UIElement |
| System.Object | domElementWhereToPlaceChildren | The dom element where the UIElement's children will be added. |
Returns
| Type | Description |
|---|---|
| System.Object | The "root" dom element of the UIElement. |
GetVisualChild(Int32)
Returns a child at the specified index from a collection of child elements.
Declaration
protected virtual UIElement GetVisualChild(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | The zero-based index of the requested child element in the collection. |
Returns
| Type | Description |
|---|---|
| UIElement | The requested child element. This should not return null; if the provided index is out of range, an exception is thrown. |
INTERNAL_AttachToDomEvents()
Declaration
public virtual void INTERNAL_AttachToDomEvents()
INTERNAL_DetachFromDomEvents()
Declaration
public virtual void INTERNAL_DetachFromDomEvents()
InvalidateArrange()
Invalidates the arrange state (layout) for a UIElement. After the invalidation, the UIElement will have its layout updated, which will occur asynchronously.
Declaration
public void InvalidateArrange()
InvalidateMeasure()
Invalidates the measurement state (layout) for a UIElement.
Declaration
public void InvalidateMeasure()
ManageIsEnabled(Boolean)
Declaration
protected virtual void ManageIsEnabled(bool isEnabled)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | isEnabled |
Measure(Size)
Updates the DesiredSize of a UIElement. Typically, objects that implement custom layout for their layout children call this method from their own MeasureOverride(Size) implementations to form a recursive layout update.
Declaration
public void Measure(Size availableSize)
Parameters
| Type | Name | Description |
|---|---|---|
| Size | availableSize | The available space that a parent can allocate a child object. A child object can request a larger space than what is available; the provided size might be accommodated if scrolling or other resize behavior is possible in that particular container. |
Remarks
There is no reason to call Measure(Size) or Arrange(Rect) outside of the context of overriding methods that perform custom layout actions. Silverlight layout works autonomously, based on detecting changes to the object tree and layout-relevant properties at run time. The availableSize you pass to Measure(Size) cannot have a System.Double.NaN value for either the Height or Width of the Size. availableSize values can be any number from zero to infinite. Elements participating in layout should return the minimum Size they require for a given availableSize.
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | availableSize contained a System.Double.NaN value. See Remarks. |
OnCreateAutomationPeer()
When implemented in a derived class, returns class-specific AutomationPeer implementations for the Silverlight automation infrastructure.
Declaration
protected virtual AutomationPeer OnCreateAutomationPeer()
Returns
| Type | Description |
|---|---|
| AutomationPeer | The class-specific AutomationPeer subclass to return. |
OnGotFocus(RoutedEventArgs)
Raises the GotFocus event
Declaration
protected virtual void OnGotFocus(RoutedEventArgs eventArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| RoutedEventArgs | eventArgs | The arguments for the event. |
OnKeyDown(KeyEventArgs)
Raises the KeyDown event
Declaration
protected virtual void OnKeyDown(KeyEventArgs eventArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyEventArgs | eventArgs | The arguments for the event. |
OnKeyUp(KeyEventArgs)
Raises the KeyUp event
Declaration
protected virtual void OnKeyUp(KeyEventArgs eventArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyEventArgs | eventArgs | The arguments for the event. |
OnLostFocus(RoutedEventArgs)
Raises the LostFocus event
Declaration
protected virtual void OnLostFocus(RoutedEventArgs eventArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| RoutedEventArgs | eventArgs | The arguments for the event. |
OnLostMouseCapture(MouseEventArgs)
Called before the LostMouseCapture event occurs to provide handling for the event in a derived class without attaching a delegate.
Declaration
protected virtual void OnLostMouseCapture(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| MouseEventArgs | e | A MouseEventArgs that contains the event data. |
OnMouseEnter(MouseEventArgs)
Raises the PointerEntered event
Declaration
protected virtual void OnMouseEnter(MouseEventArgs eventArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| MouseEventArgs | eventArgs | The arguments for the event. |
OnMouseLeave(MouseEventArgs)
Raises the PointerExited event
Declaration
protected virtual void OnMouseLeave(MouseEventArgs eventArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| MouseEventArgs | eventArgs | The arguments for the event. |
OnMouseLeftButtonDown(MouseButtonEventArgs)
Raises the PointerPressed event
Declaration
protected virtual void OnMouseLeftButtonDown(MouseButtonEventArgs eventArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| MouseButtonEventArgs | eventArgs | The arguments for the event. |
OnMouseLeftButtonUp(MouseButtonEventArgs)
Raises the PointerReleased event
Declaration
protected virtual void OnMouseLeftButtonUp(MouseButtonEventArgs eventArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| MouseButtonEventArgs | eventArgs | The arguments for the event. |
OnMouseMove(MouseEventArgs)
Raises the PointerMoved event
Declaration
protected virtual void OnMouseMove(MouseEventArgs eventArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| MouseEventArgs | eventArgs | The arguments for the event. |
OnMouseRightButtonDown(MouseButtonEventArgs)
Raises the MouseRightButtonDown event
Declaration
protected virtual void OnMouseRightButtonDown(MouseButtonEventArgs eventArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| MouseButtonEventArgs | eventArgs | The arguments for the event. |
OnMouseRightButtonUp(MouseButtonEventArgs)
Raises the RightTapped event
Declaration
protected virtual void OnMouseRightButtonUp(MouseButtonEventArgs eventArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| MouseButtonEventArgs | eventArgs | The arguments for the event. |
OnMouseWheel(MouseWheelEventArgs)
Raises the PointerWheelChanged event
Declaration
protected virtual void OnMouseWheel(MouseWheelEventArgs eventArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| MouseWheelEventArgs | eventArgs | The arguments for the event. |
OnPropertyChanged(DependencyPropertyChangedEventArgs)
Invoked whenever the effective value of any dependency property on this DependencyObject has been updated. The specific dependency property that changed is reported in the event data.
Declaration
protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyPropertyChangedEventArgs | e | Event data that will contain the dependency property identifier of interest, the property metadata for the type, and old and new values. |
Overrides
| Improve this Doc View SourceOnTapped(TappedRoutedEventArgs)
Raises the Tapped event
Declaration
protected virtual void OnTapped(TappedRoutedEventArgs eventArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| TappedRoutedEventArgs | eventArgs | The arguments for the event. |
OnTextInput(TextCompositionEventArgs)
Called before the TextInput event occurs.
Declaration
protected virtual void OnTextInput(TextCompositionEventArgs eventArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| TextCompositionEventArgs | eventArgs | A TextCompositionEventArgs that contains the event data. |
OnTextInputStart(TextCompositionEventArgs)
Called before the TextInputStart event occurs.
Declaration
protected virtual void OnTextInputStart(TextCompositionEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| TextCompositionEventArgs | e | A TextCompositionEventArgs that contains the event data. |
OnVisualChildrenChanged(DependencyObject, DependencyObject)
Called when the visual element collection of the visual object is modified.
Declaration
protected virtual void OnVisualChildrenChanged(DependencyObject visualAdded, DependencyObject visualRemoved)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | visualAdded | The UIElement that was added to the collection. |
| DependencyObject | visualRemoved | The UIElement that was removed from the collection. |
OnVisualParentChanged(DependencyObject)
Called when the parent of the visual object is changed.
Declaration
protected virtual void OnVisualParentChanged(DependencyObject oldParent)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | oldParent | A value of type DependencyObject that represents the previous parent of the UIElement object. If the UIElement object did not have a previous parent, the value of the parameter is null. |
ReleaseMouseCapture()
Releases pointer captures for capture of one specific pointer by this UIElement.
Declaration
public void ReleaseMouseCapture()
RemoveHandler(RoutedEvent, Delegate)
Removes the specified routed event handler from this UIElement.
Declaration
public void RemoveHandler(RoutedEvent routedEvent, Delegate handler)
Parameters
| Type | Name | Description |
|---|---|---|
| RoutedEvent | routedEvent | The identifier of the routed event for which the handler is attached. |
| System.Delegate | handler | The specific handler implementation to remove from the event handler collection on this UIElement. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | routedEvent or handler is null. |
| System.ArgumentException | routedEvent does not represent a supported routed event.-or-handler does not implement a supported delegate. |
| System.NotImplementedException | Attempted to remove handler for an event not supported by the current platform variation. |
RemoveVisualChild(UIElement)
Removes the parent-child relationship between two visuals.
Declaration
protected void RemoveVisualChild(UIElement child)
Parameters
| Type | Name | Description |
|---|---|---|
| UIElement | child | The child visual object to remove from the parent visual. |
TransformToVisual(UIElement)
Returns a transform object that can be used to transform coordinates from the UIElement to the specified object.
Declaration
public GeneralTransform TransformToVisual(UIElement visual)
Parameters
| Type | Name | Description |
|---|---|---|
| UIElement | visual | The object to compare to the current object for purposes of obtaining the transform. |
Returns
| Type | Description |
|---|---|
| GeneralTransform | The transform information as an object. Call methods on this object to get a practical transform. |
UpdateLayout()
Ensures that all positions of child objects of a UIElement are properly updated for layout.
Declaration
public void UpdateLayout()
Events
| Improve this Doc View SourceDragEnter
Declaration
[NotImplemented]
public event DragEventHandler DragEnter
Event Type
| Type | Description |
|---|---|
| DragEventHandler |
DragLeave
Declaration
[NotImplemented]
public event DragEventHandler DragLeave
Event Type
| Type | Description |
|---|---|
| DragEventHandler |
DragOver
Declaration
[NotImplemented]
public event DragEventHandler DragOver
Event Type
| Type | Description |
|---|---|
| DragEventHandler |
Drop
Declaration
[NotImplemented]
public event DragEventHandler Drop
Event Type
| Type | Description |
|---|---|
| DragEventHandler |
GotFocus
Occurs when the pointer device that previously initiated a Press action is pressed, while within this element. Note that ONLY sender's informations are currently filled (not pointer's)
Declaration
public event RoutedEventHandler GotFocus
Event Type
| Type | Description |
|---|---|
| RoutedEventHandler |
IsEnabledChanged
Occurs when the IsEnabled property changes.
Declaration
public event DependencyPropertyChangedEventHandler IsEnabledChanged
Event Type
| Type | Description |
|---|---|
| DependencyPropertyChangedEventHandler |
IsVisibleChanged
Occurs when the value of the IsVisible property changes on this element.
Declaration
public event DependencyPropertyChangedEventHandler IsVisibleChanged
Event Type
| Type | Description |
|---|---|
| DependencyPropertyChangedEventHandler |
KeyDown
Occurs when a keyboard key is pressed while the UIElement has focus.
Declaration
public event KeyEventHandler KeyDown
Event Type
| Type | Description |
|---|---|
| KeyEventHandler |
KeyUp
Occurs when a keyboard key is released while the UIElement has focus.
Declaration
public event KeyEventHandler KeyUp
Event Type
| Type | Description |
|---|---|
| KeyEventHandler |
LostFocus
Occurs when a UIElement loses focus.
Declaration
public event RoutedEventHandler LostFocus
Event Type
| Type | Description |
|---|---|
| RoutedEventHandler |
LostMouseCapture
Declaration
public event MouseEventHandler LostMouseCapture
Event Type
| Type | Description |
|---|---|
| MouseEventHandler |
MouseEnter
Occurs when a pointer enters the hit test area of this element.
Declaration
public event MouseEventHandler MouseEnter
Event Type
| Type | Description |
|---|---|
| MouseEventHandler |
MouseLeave
Occurs when a pointer leaves the hit test area of this element.
Declaration
public event MouseEventHandler MouseLeave
Event Type
| Type | Description |
|---|---|
| MouseEventHandler |
MouseLeftButtonDown
Occurs when the pointer device that previously initiated a Press action is pressed, while within this element.
Declaration
public event MouseButtonEventHandler MouseLeftButtonDown
Event Type
| Type | Description |
|---|---|
| MouseButtonEventHandler |
MouseLeftButtonUp
Occurs when the pointer device that previously initiated a Press action is released, while within this element.
Declaration
public event MouseButtonEventHandler MouseLeftButtonUp
Event Type
| Type | Description |
|---|---|
| MouseButtonEventHandler |
MouseMove
Occurs when the pointer device that previously initiated a Press action is moved, while within this element.
Declaration
public event MouseEventHandler MouseMove
Event Type
| Type | Description |
|---|---|
| MouseEventHandler |
MouseRightButtonDown
Declaration
public event MouseButtonEventHandler MouseRightButtonDown
Event Type
| Type | Description |
|---|---|
| MouseButtonEventHandler |
MouseRightButtonUp
Occurs when a right-tap input stimulus happens while the pointer is over the element.
Declaration
public event MouseButtonEventHandler MouseRightButtonUp
Event Type
| Type | Description |
|---|---|
| MouseButtonEventHandler |
MouseWheel
Occurs when the user rotates the mouse wheel while the mouse pointer is over a UIElement, or the UIElement has focus.
Declaration
public event MouseWheelEventHandler MouseWheel
Event Type
| Type | Description |
|---|---|
| MouseWheelEventHandler |
Tapped
Occurs when an otherwise unhandled Tap interaction occurs over the hit test area of this element.
Declaration
public event TappedEventHandler Tapped
Event Type
| Type | Description |
|---|---|
| TappedEventHandler |
TextInput
Occurs when a UI element gets text in a device-independent manner.
Declaration
public event TextCompositionEventHandler TextInput
Event Type
| Type | Description |
|---|---|
| TextCompositionEventHandler |
TextInputStart
Occurs when a UI element initially gets text in a device-independent manner.
Declaration
public event TextCompositionEventHandler TextInputStart
Event Type
| Type | Description |
|---|---|
| TextCompositionEventHandler |
TextInputUpdate
Occurs when text continues to be composed via an input method editor (IME).
Declaration
[NotImplemented]
public event TextCompositionEventHandler TextInputUpdate
Event Type
| Type | Description |
|---|---|
| TextCompositionEventHandler |