Color legend plain property dependency property method event
BaseElement is the abstract base of every element: buttons, labels, panels, windows and your own elements. Everything on this page applies to all of them.
The base element page shows it in context, with code and screenshots.
Names are colored by what they are: a plain property, a method, an event or a dependency property, which a style, a binding or an animation can set.
Properties
ActualHeight 🠆
int · Read-only. The height the last layout gave the element, within its size limits.
ActualSizeRectangleColor 🠆
Color · The color of the bounds outline, Green by default.
ActualWidth 🠆
int · Read-only. The width the last layout gave the element, within its size limits.
BackgroundColor 🠆
Color · The color the element’s background is filled with. Transparent (the default) fills nothing; lists, combo boxes, tooltips, progress bars and separators have a color of their own unless set (see default settings).
Bottom 🠆
int · Read-only. Top + ActualHeight.
Bounds 🠆
Rectangle · Read-only. Location and the actual size as one rectangle.
Children 🠆
IReadOnlyList<BaseElement> · Read-only. The element’s children: its items and the parts it made itself.
ContextMenu 🠆
ContextMenu · Opened at the mouse by a right click on the element, or on an element inside it without a menu of its own. See ContextMenu.
CropOutsideOfParentBorder 🠆
bool · Clips the element to its parent’s bounds. Without it the element may overflow its parent but is still clipped by whatever clips the parent (a scroll view, a window’s content area). On by default for every element with a style.
CustomEffect 🠆
Effect · A shader the element draws its background (or texture, an image’s picture) with. Setting it sets it on the children as well, and a child added later takes it. An effect with a ModulationColor parameter gets the draw color there.
DefaultMouseCursorsSet 🠆
MouseCursorsSet · Static. The cursors of every element without a more specific set: an arrow on hover, the sizing arrows over resize areas, a text cursor over editable text, a hand over a link, a hand over an element that can be dragged, while it is dragged and over an allowed drop, and a “no” cursor over a denied drop. BorrowedTorchUI.SetDefaultMouseCursorsSet sets it too.
DesiredHeight 🠆
int · The height in units. 0 (the default) fits the content, or stretches over the slot when VerticalAlignment is Stretch.
DesiredWidth 🠆
int · The width in units. 0 (the default) fits the content, or stretches over the slot when HorizontalAlignment is Stretch.
Disabled 🠆
bool · Stops the element and its subtree from showing states, raising mouse events and taking the keyboard, and draws them darker.
DoubleClickIntervalMs 🠆
int · The longest time in milliseconds between two left presses that make a double click. 300 by default; negative values are taken as 0.
DragAndDropRepresentation 🠆
DragAndDropRepresentation · What is drawn under the mouse while the element is the dragged one. Detached, not disposed, with the element.
DragTarget 🠆
BaseElement · The element that is dragged; the element itself by default.
DragType 🠆
DragType · Whether a press on the element drags something: nothing (the default), the element itself, or a drag and drop.
DropAllowedTint 🠆
Color · Static. The tint of a drop target that takes the dragged element, (0, 100, 0, 10) by default.
DropDeniedTint 🠆
Color · Static. The tint of a drop target that denies it, (100, 0, 0, 10) by default.
ForegroundColor 🠆
Color · The color of what the element draws over its background, such as a label’s text. An element drawn from textures tints them with it when it is not Transparent.
GridColumn 🠆
int · The column the element starts in, from 0.
GridColumnSpan 🠆
int · How many columns the element covers; values below 1 are taken as 1.
GridRow 🠆
int · The row the element starts in, from 0.
GridRowSpan 🠆
int · How many rows the element covers; values below 1 are taken as 1.
HitRectangle 🠆
Rectangle · Read-only. The part of the element on screen: its bounds as its cropping parents leave them (a scrollable container, CropOutsideOfParentBorder), empty when it is cropped away. The mouse hits the element only inside it.
HitRectangleColor 🠆
Color · The color of the hit rectangle outline, White by default.
HitTest 🠆
bool · Whether the element itself takes the mouse. On by default for every element with a style; off for an element deriving from BaseElement directly.
HorizontalAlignment 🠆
HorizontalAlignment · Where the element sits in its slot horizontally, and whether it stretches over it. The default is Stretch.
HoverTint 🠆
Color · Static. The tint of a hovered element, (0, 10, 60, 10) by default.
Id 🠆
Guid · Read-only. A unique id made when the element is created.
InheritState 🠆
InheritState · Which states the element shows besides its own: its parent’s, its children’s, both or none (the default).
IsDisposed 🠆
bool · Read-only. True once Dispose() was called.
IsDropAllowedPredicate 🠆
IfDropAllowed · Decides whether a dragged element can be dropped here: bool (BaseElement draggedElement). Without one every drop is denied.
IsFocused 🠆
bool · Read-only. True while the element has the keyboard.
IsPart 🠆
bool · Read-only. Whether the element is a part of its control: made by the control as one of the pieces it is drawn with (a button’s label, a combo box’s list), not given to it as content or as an item. For a tool that shows the element tree.
IsResizable 🠆
bool · Lets the user resize the element by dragging its edges and corners.
Left 🠆
int · Read-only. Location.X.
Location 🠆
Point · Read-only. The top left corner of the element on the screen.
Margin 🠆
Margin · The space between the element and the edges of its slot. Which sides count is described above.
MaxHeight 🠆
int · The largest height the layout (and a resize) gives the element. 0 is no limit.
MaxWidth 🠆
int · The largest width the layout (and a resize) gives the element. 0 is no limit.
MeasuredContentHeight 🠆
int · Read-only. The height the content needed at the last measure.
MeasuredContentWidth 🠆
int · Read-only. The width the content needed at the last measure, whatever width the element was given.
MeasuredHeight 🠆
int · Read-only. The height the last measure found.
MeasuredWidth 🠆
int · Read-only. The width the last measure found: fixed, stretched over the slot or fitted to the content.
MinHeight 🠆
int · The smallest height the layout (and a resize) gives the element. 0 is no limit.
MinWidth 🠆
int · The smallest width the layout (and a resize) gives the element. 0 is no limit.
ModalWindowActiveShadeTint 🠆
Color · Static. The shade drawn over everything below the top modal window, (0, 0, 0, 75) by default. Always drawn, not a debug setting.
MouseCursorsSet 🠆
MouseCursorsSet · Read-only. The cursors the element shows. On an element without a style: its control’s cursors when it is a part of one, otherwise DefaultMouseCursorsSet.
Name 🠆
string · Read-only. The name given to the constructor, used by GetElementByName; it never changes. The parts an element makes are named after it.
Parent 🠆
BaseElement · Read-only. The element this one is in, null when it is not in one.
PostDrawAction 🠆
Action · Runs after the element and its subtree are drawn, for example to restore what PreDrawAction changed.
PreDrawAction 🠆
Action · Runs before the element and its subtree are drawn, for example to change the sprite batch state.
PressedTint 🠆
Color · Static. The tint of a pressed element, (128, 128, 0, 10) by default.
RepeatClicks 🠆
bool · Raises OnClick on the press and repeatedly while the left button is held, instead of once on release. Off by default.
ResizeAreaHalfWidth 🠆
int · How far the resize areas reach to each side of the edges, in units. 3 by default (DefaultSettings.DefaultResizeAreaHalfWidth); negative values are taken as 0.
ResizeContourColor 🠆
Color · The color of the contour. (50, 50, 50, 190) by default (DefaultSettings.DefaultResizeContourColor); it fades and darkens with the element.
ResizeWithElementContour 🠆
bool · Shows a contour while dragging and resizes the element once on release, instead of resizing it as the mouse moves.
Right 🠆
int · Read-only. Left + ActualWidth.
ShowActualSizeRectangle 🠆
bool · Outlines the element’s Bounds, without clipping.
ShowActualSizeRectangleDiagonals 🠆
bool · Adds the diagonals to the bounds outline.
ShowHitRectangle 🠆
bool · Outlines the element’s hit rectangle: its bounds as clipped by its parents.
ShowHitRectangleDiagonals 🠆
bool · Adds the diagonals to the hit rectangle outline.
ShowStateTint 🠆
bool · Static. Draws the state tints below over the elements. Off by default.
StateData 🠆
ElementStateData · Read-only. The state the element shows now and where it comes from.
TexturesPath 🠆
string · A content folder with the element’s textures, for example UITextures/Button/. A missing trailing path separator is added.
TexturesPresent 🠆
bool · Read-only. True when TexturesPath is set.
TimeBeforeRepeatStartsMs 🠆
int · Milliseconds from the press to the first repeated click. 1000 by default; negative values are taken as 0.
TimeBetweenRepeatsMs 🠆
int · Milliseconds between the repeated clicks after the first one. 300 by default; negative values are taken as 0.
ToolTip 🠆
ToolTip · Shown while the element is hovered, after the tooltip’s delay. See ToolTip.
Top 🠆
int · Read-only. Location.Y.
Transparency 🠆
float · From 0 (opaque, the default) to 1 (invisible); values outside are clamped. Applies to the element and its subtree, combined with the parents’ transparency.
VerticalAlignment 🠆
VerticalAlignment · Where the element sits in its slot vertically, and whether it stretches over it. The default is Stretch.
Visibility 🠆
Visibility · Whether the element is shown, hidden in its space or collapsed. The default is Visible. A hidden element loses the keyboard focus and any mouse state.
ZIndex 🠆
int · The element’s place among its overlapping siblings: a higher one is drawn above them and gets the mouse first, a lower one (it can be negative) goes below. The default is 0; siblings with the same one keep the order they were added in.
Methods
AcceptsItems() 🠆
AcceptsItems · Protected virtual property, true by default. Return false and the item methods do nothing on the element.
ActualHeightChangedHandlerOverride() 🠆
ActualHeightChangedHandlerOverride(int height) · The layout gave the element another height.
| Parameter | Type | Description |
|---|---|---|
height |
int |
The element’s new actual height, in units. |
ActualWidthChangedHandlerOverride() 🠆
ActualWidthChangedHandlerOverride(int width) · The layout gave the element another width.
| Parameter | Type | Description |
|---|---|---|
width |
int |
The element’s new actual width, in units. |
AddChild() 🠆
AddChild(BaseElement child, bool isSole = false, int insertIndex = -1, bool isVisualComponent = true) · Protected. Adds a child; by default an own part, which the item methods leave alone and which is disposed when it is removed. isSole removes the other items first.
| Parameter | Type | Description |
|---|---|---|
child |
BaseElement |
The element to add. One that has another parent throws InvalidOperationException. |
isSole |
bool |
Whether the element’s other items are removed first, so the child is its only item (its parts stay). Default: false. |
insertIndex |
int |
The position in Children to insert the child at; -1, or a position past the end, adds it last. Default: -1. |
isVisualComponent |
bool |
Whether the child is a part of the element (IsVisualComponent): the item methods leave a part alone, and it is disposed when it is removed. Pass false for an item, which is only detached. Default: true. |
AddItem() 🠆
AddItem(BaseElement item) · Adds the item after the other children.
| Parameter | Type | Description |
|---|---|---|
item |
BaseElement |
The element to add. |
AddItemAt() 🠆
AddItemAt(BaseElement item, int index) · Inserts the item at the index in Children. An index below 0 or above the count is ignored.
| Parameter | Type | Description |
|---|---|---|
item |
BaseElement |
The element to insert. |
index |
int |
The position to insert it at: 0 for the first, the number of items for the end. |
AddItemsRange() 🠆
AddItemsRange(IEnumerable<BaseElement> items) · Adds the items in order after the other children.
| Parameter | Type | Description |
|---|---|---|
items |
IEnumerable<BaseElement> |
The elements to add, in order. |
AddItemsRangeAt() 🠆
AddItemsRangeAt(IEnumerable<BaseElement> items, int index) · Inserts the items in order from the index; a null item takes no place.
| Parameter | Type | Description |
|---|---|---|
items |
IEnumerable<BaseElement> |
The elements to insert, in order. |
index |
int |
The position of the first one: 0 for the first, the number of items for the end. |
ApplyGeneralStyle() 🠆
ApplyGeneralStyle() · Protected, of GenericStyleAndMouseCursorsData<TStyle>. Applies the general style over the framework defaults.
ApplyStyle() 🠆
ApplyStyle(BaseStyle style, ValueSources valueSource) · Protected. Applies the style’s assigned properties to the element as the given value source.
| Parameter | Type | Description |
|---|---|---|
style |
BaseStyle |
The style whose assigned properties are applied. |
valueSource |
ValueSources |
The source the style’s values are stored for, such as ValueSources.StyleOverride. |
ApplyStyleOverride() 🠆
ApplyStyleOverride() · Protected, of GenericStyleAndMouseCursorsData<TStyle>. Applies the style override again.
Arrange() 🠆
Arrange(Rectangle slot) · Gives the element its size and position in the slot: a stretched element takes the slot less its margins, the others keep their measured size and are placed by their margins and alignment.
| Parameter | Type | Description |
|---|---|---|
slot |
Rectangle |
The rectangle the parent gives the element, in units. |
ArrangeAt() 🠆
ArrangeAt(Point position) · Places the element at a position its container chose, at its measured size; its margins and alignment are not applied.
| Parameter | Type | Description |
|---|---|---|
position |
Point |
The element’s position, chosen by its container, in units. |
ArrangeAt(Rectangle bounds) · Places the element at a position and size its container chose.
| Parameter | Type | Description |
|---|---|---|
bounds |
Rectangle |
The element’s position and size, chosen by its container, in units. |
ArrangeContent() 🠆
ArrangeContent() · Protected virtual. Arranges the children inside Bounds, as described above.
ClearItems() 🠆
ClearItems() · Takes every item out without disposing them; the element’s own parts stay.
ClickHandlerOverride() 🠆
ClickHandlerOverride(BaseElement sender, MouseClickEventArgs e) · Before OnClick.
| Parameter | Type | Description |
|---|---|---|
sender |
BaseElement |
The element clicked. |
e |
MouseClickEventArgs |
Where the mouse was and the states of its buttons. |
CursorsPropertyChangedHandler() 🠆
CursorsPropertyChangedHandler() · Protected. Shows the element’s current cursors again, after its cursor set changed.
DetachChild() 🠆
DetachChild(BaseElement child) · Protected. Takes a child out without disposing it, to add it again later.
| Parameter | Type | Description |
|---|---|---|
child |
BaseElement |
The child to take out. |
DetachChildren() 🠆
DetachChildren() · Protected. Takes every child out without disposing them.
DetachChildren(Predicate<BaseElement> match) · Protected. Takes the matching children out without disposing them.
| Parameter | Type | Description |
|---|---|---|
match |
Predicate<BaseElement> |
Picks the children to take out: true for each one to detach. |
Dispose() 🠆
Dispose() · Marks the object disposed and runs DisposeHandler once; later calls do nothing.
DisposeHandler() 🠆
DisposeHandler() · Protected override. The element’s dispose (see items and content); call the base when you override it.
DoubleClickHandlerOverride() 🠆
DoubleClickHandlerOverride(BaseElement sender, MouseClickEventArgs e) · Before OnDoubleClick.
| Parameter | Type | Description |
|---|---|---|
sender |
BaseElement |
The element double-clicked. |
e |
MouseClickEventArgs |
Where the mouse was and the states of its buttons. |
DoubleClickIntervalMsPropertyChangedHandlerOverride() 🠆
DoubleClickIntervalMsPropertyChangedHandlerOverride(int value) · DoubleClickIntervalMs changed (after it was passed to the parts).
| Parameter | Type | Description |
|---|---|---|
value |
int |
The new interval, in milliseconds. |
Draw() 🠆
Draw() · Draws the element, its children and the popups above them. The UI calls it on the root every frame, you don’t call it yourself.
Focus() 🠆
Focus() · Gives the element the keyboard. Returns false when it can’t take it: it is not in the tree, hidden or disabled.
ForegroundColorPropertyChangedHandlerOverride() 🠆
ForegroundColorPropertyChangedHandlerOverride(Color value) · ForegroundColor changed.
| Parameter | Type | Description |
|---|---|---|
value |
Color |
The new foreground color. |
GenericStyleAndMouseCursorsData() 🠆
GenericStyleAndMouseCursorsData(string name = null) · Protected. The same, for an element with a style.
| Parameter | Type | Description |
|---|---|---|
name |
string |
The element’s Name, which GetElementByName finds it by. Default: null. |
GetElementByName() 🠆
GetElementByName(string name) · Finds an element by name below this one (its children first, then deeper, popups such as its tooltip included). Null when there is none.
| Parameter | Type | Description |
|---|---|---|
name |
string |
The Name to look for. |
GotFocusHandlerOverride() 🠆
GotFocusHandlerOverride() · The element got the keyboard.
HitTestPropertyChangedHandlerOverride() 🠆
HitTestPropertyChangedHandlerOverride(bool value) · HitTest changed.
| Parameter | Type | Description |
|---|---|---|
value |
bool |
The new value of HitTest. |
InheritStatePropertyChangedHandlerOverride() 🠆
InheritStatePropertyChangedHandlerOverride(InheritState value) · InheritState changed.
| Parameter | Type | Description |
|---|---|---|
value |
InheritState |
The new value of InheritState. |
InvalidateArrange() 🠆
InvalidateArrange() · Asks for the element’s children to be placed again; its size stays.
InvalidateMeasure() 🠆
InvalidateMeasure() · Asks for a new measure and arrange of the element: a setting of its own changed its size or its content’s.
KeyDownHandlerOverride() 🠆
KeyDownHandlerOverride(KeyDownEventArgs e) · A key reached the element, before OnKeyDown; set e.Handled for a key the element uses.
| Parameter | Type | Description |
|---|---|---|
e |
KeyDownEventArgs |
The pressed key. Set e.Handled for a key the element uses. |
LoadTextures() 🠆
LoadTextures() · Protected virtual. Called when TexturesPath changes; load the element’s textures from the folder here and call the base.
LocationChangedHandlerOverride() 🠆
LocationChangedHandlerOverride(Point location) · The element moved.
| Parameter | Type | Description |
|---|---|---|
location |
Point |
The element’s new position on the screen, in units. |
LostFocusHandlerOverride() 🠆
LostFocusHandlerOverride() · The element lost the keyboard. Focusing another element here (the next field of a form) works.
Measure() 🠆
Measure(int slotWidth, int slotHeight) · Measures the element for the slot its parent gives it (-1: a size the parent does not know yet): a stretched element takes the slot less its margins, a fixed one its desired size, the others fit their content.
| Parameter | Type | Description |
|---|---|---|
slotWidth |
int |
The width of the slot the parent gives the element, in units, or -1 when the parent doesn’t know it yet. |
slotHeight |
int |
The height of the slot the parent gives the element, in units, or -1 when the parent doesn’t know it yet. |
MeasureAt() 🠆
MeasureAt(int width, int height) · Measures the element at a size its container chose for it; along a side given as -1 it has its own size (fixed, or fitted to its content).
| Parameter | Type | Description |
|---|---|---|
width |
int |
The width the container chose, in units, or -1 for the element’s own width (fixed, or fitted to its content). |
height |
int |
The height the container chose, in units, or -1 for the element’s own height (fixed, or fitted to its content). |
MeasureContent() 🠆
MeasureContent(int width, int height) · Protected virtual, returns Point. Measures the children and returns the content size, as described above.
| Parameter | Type | Description |
|---|---|---|
width |
int |
The element’s width, in units, or -1 where the element fits its content. |
height |
int |
The element’s height, in units, or -1 where the element fits its content. |
MouseEnterHandlerOverride() 🠆
MouseEnterHandlerOverride() · Before OnMouseEnter.
MouseLeaveHandlerOverride() 🠆
MouseLeaveHandlerOverride() · Before OnMouseLeave.
RemoveChild() 🠆
RemoveChild(BaseElement child) · Protected. Takes a child out: an own part is disposed, an item only detached.
| Parameter | Type | Description |
|---|---|---|
child |
BaseElement |
The child to take out. |
RemoveChildAt() 🠆
RemoveChildAt(int index) · Protected. The same, by index in Children.
| Parameter | Type | Description |
|---|---|---|
index |
int |
The index in Children of the child to take out. |
RemoveItem() 🠆
RemoveItem(BaseElement item) · Takes the item out without disposing it. Does nothing for a part of the element.
| Parameter | Type | Description |
|---|---|---|
item |
BaseElement |
The element to take out. |
RemoveItemAt() 🠆
RemoveItemAt(int index) · Takes the item at the index out without disposing it.
| Parameter | Type | Description |
|---|---|---|
index |
int |
The index of the item to take out. |
RemoveItemsRangeAt() 🠆
RemoveItemsRangeAt(int index, int count) · Takes count items out from the index on (fewer when the children end first), without disposing them.
| Parameter | Type | Description |
|---|---|---|
index |
int |
The index of the first item to take out. |
count |
int |
The number of items to take out. |
StateChangedHandlerOverride() 🠆
StateChangedHandlerOverride(BaseElement sender, ElementStateData stateData) · The shown state changed, before OnStateChanged.
| Parameter | Type | Description |
|---|---|---|
sender |
BaseElement |
The element whose shown state changed. |
stateData |
ElementStateData |
The new state and where it comes from. |
Style() 🠆
Style · Protected property of GenericStyleAndMouseCursorsData<TStyle>: the style override, or the general style.
TextInputHandlerOverride() 🠆
TextInputHandlerOverride(TextInputEventArgs e) · Typed text reached the focused element.
| Parameter | Type | Description |
|---|---|---|
e |
TextInputEventArgs |
The typed character (MonoGame’s TextInputEventArgs). |
TimeBeforeRepeatStartsMsPropertyChangedHandlerOverride() 🠆
TimeBeforeRepeatStartsMsPropertyChangedHandlerOverride(int value) · TimeBeforeRepeatStartsMs changed (after it was passed to the parts).
| Parameter | Type | Description |
|---|---|---|
value |
int |
The new time, in milliseconds. |
TimeBetweenRepeatsMsPropertyChangedHandlerOverride() 🠆
TimeBetweenRepeatsMsPropertyChangedHandlerOverride(int value) · TimeBetweenRepeatsMs changed (after it was passed to the parts).
| Parameter | Type | Description |
|---|---|---|
value |
int |
The new time, in milliseconds. |
UnsubscribeSelf() 🠆
UnsubscribeSelf() · Protected virtual. Called on dispose: release the element’s subscriptions to other objects here.
ValueSourceOf() 🠆
ValueSourceOf(string propertyName) · Where the value of the element’s dependency property of that name comes from now, a ValueSources: set on the element (ManualAssign), by its style override (StyleOverride), by its type’s general style (GeneralStyle), or none of them (None: its default). It doesn’t create the dependency property, so one the element hasn’t used yet is None. null for a name that is no dependency property of the element. For a tool that shows an element’s properties.
| Parameter | Type | Description |
|---|---|---|
propertyName |
string |
The name of the property, such as "Text" or "NormalColor" (nameof(Button.Text)). A dependency property of a base class counts too; an empty name or null gives null. |
VisibilityChangedHandlerOverride() 🠆
VisibilityChangedHandlerOverride(Visibility visibility) · Visibility changed; called before the children hear of it.
| Parameter | Type | Description |
|---|---|---|
visibility |
Visibility |
The element’s new visibility. |
VisibilityPropertyChangedHandlerOverride() 🠆
VisibilityPropertyChangedHandlerOverride(Visibility value) · Visibility changed; called after the children heard of it.
| Parameter | Type | Description |
|---|---|---|
value |
Visibility |
The element’s new visibility. |
Events
OnClick 🠆
(BaseElement sender, MouseClickEventArgs e) · A mouse button pressed on the element is released over it (with RepeatClicks: on the press and while it is held).
| Parameter | Type | Description |
|---|---|---|
sender |
BaseElement |
The element that raised the event. |
e |
MouseClickEventArgs |
Where the mouse was and the states of its buttons. |
OnDisposed 🠆
(BaseElement sender) · The element was disposed. Raised once, at the end of Dispose(); the handlers are let go afterwards.
| Parameter | Type | Description |
|---|---|---|
sender |
BaseElement |
The element that raised the event. |
OnDoubleClick 🠆
(BaseElement sender, MouseClickEventArgs e) · The left button is pressed a second time within DoubleClickIntervalMs. Not raised by an element with RepeatClicks.
| Parameter | Type | Description |
|---|---|---|
sender |
BaseElement |
The element that raised the event. |
e |
MouseClickEventArgs |
Where the mouse was and the states of its buttons. |
OnDragAndDropStart 🠆
(BaseElement draggedElement) · A drag and drop of this element (as the DragTarget) starts; the argument is the element whose DragType started it.
| Parameter | Type | Description |
|---|---|---|
draggedElement |
BaseElement |
The element whose DragType started the drag. |
OnDrop 🠆
(BaseElement draggedElement, BaseElement dragAndDropDestination) · A dragged element is released over this element and its predicate allowed it.
| Parameter | Type | Description |
|---|---|---|
draggedElement |
BaseElement |
The dragged element. |
dragAndDropDestination |
BaseElement |
The element it was dropped on. |
OnDropDenied 🠆
(BaseElement draggedElement, BaseElement dragAndDropDestination) · A dragged element is released over this element and the drop is denied.
| Parameter | Type | Description |
|---|---|---|
draggedElement |
BaseElement |
The dragged element. |
dragAndDropDestination |
BaseElement |
The element it was released over. |
OnKeyDown 🠆
(BaseElement sender, KeyDownEventArgs e) · A key is pressed while the element, or an element inside it that left the key unhandled, has the keyboard.
| Parameter | Type | Description |
|---|---|---|
sender |
BaseElement |
The element that raised the event. |
e |
KeyDownEventArgs |
The pressed key. Set e.Handled so the element’s parents don’t get it. |
OnMouseEnter 🠆
(BaseElement sender) · The element starts taking the mouse.
| Parameter | Type | Description |
|---|---|---|
sender |
BaseElement |
The element that raised the event. |
OnMouseLeave 🠆
(BaseElement sender) · The element stops taking the mouse: the mouse left, moved onto a child that takes it, or the element got disabled or hidden.
| Parameter | Type | Description |
|---|---|---|
sender |
BaseElement |
The element that raised the event. |
OnStateChanged 🠆
(BaseElement sender, ElementStateData e) · The state the element shows changes, its own or one it takes. Raised again for every change of the mouse buttons while the element is pressed.
| Parameter | Type | Description |
|---|---|---|
sender |
BaseElement |
The element that raised the event. |
e |
ElementStateData |
The new state and where it comes from. |