Represents a base requirements for an element that has a user interface.
Properties
ActualHeight
Gets the actual height of the element.
Property Value
- int:
The actual height of the element.
Remarks
This is determined by the layout system after Arrange(Rectangle) has completed.
This is only valid if Istrue
.
ActualWidth
Gets the actual width of the element.
Property Value
- int:
The actual width of the element.
Remarks
This is determined by the layout system after Arrange(Rectangle) has completed.
This is only valid if Istrue
.
Bounds
Gets a Rectangle specifying the bounds of the element.
ClipBounds
Gets a Rectangle specifying the clip bounds when drawing the element.
DesiredSize
Gets the desired size of the element as computed by Measure(Graphics, Size).
Property Value
- Size:
The desired size of the element as computed by Measure(Graphics, Size).
Remarks
This is only valid if Istrue
.
IsArrangeValid
Gets whether the value of the Desired
Property Value
- bool:
true
if the value of the DesiredSize property and position of child elements is valid; otherwise,false
.
Remarks
A developer can force arrangement to be invalidated by calling Invalidate
IsMeasureValid
Gets whether the value of the Desired
Property Value
- bool:
true
if the value of the DesiredSize property is valid; otherwise,false
.
Remarks
A developer can force arrangement to be invalidated by calling Invalidate
IsRightToLeft
Gets whether the element is using a right-to-left layout.
Property Value
- bool:
true
if the element is using a right-to-left layout; otherwise,false
.
Size
Gets the actual size of the element.
Property Value
- Size:
The actual size of the element.
Remarks
This is determined by the layout system after Arrange(Rectangle) has completed.
This is only valid if Istrue
.
Visibility
Gets or sets the Visibility of the element.
Property Value
- Visibility:
The Visibility of the element.
VisualOffset
Gets the X/Y offset of the element relative to its parent element's coordinate system.
Property Value
- Point:
The X/Y offset of the element relative to its parent element's coordinate system.
Remarks
This is determined by the layout system after Arrange(Rectangle) has completed.
This is only valid if Istrue
.
Methods
Arrange(Rectangle)
Positions child elements and determines a size for the IUIElement.
Parameter | Type | Description |
---|---|---|
newBounds | Rectangle | The final bounds of the element. |
ContainsLocation(Point)
Used with hit-testing, returning whether this element's bounds contains the specified location.
Parameter | Type | Description |
---|---|---|
location | Point | The Point location to examine. |
Returns
- bool:
true
if this element's bounds contains the specified location; otherwise,false
.
Remarks
Override this method to prevent certain portions of the element's bounds from being included in hit-testing.
CreateGraphics()
Creates the Graphics object for the use with the object.
GetDrawState()
Gets the UIElement
Returns
- UIElement
Draw :State The UIElement
Draw for the element.State
Remarks
The default implementation of this method returns UIElementDrawState.None
.
HitTest(PointHitTestParameters)
Hit tests to find the IUIElement that contains the specified coordinates.
Parameter | Type | Description |
---|---|---|
hitTestParams | Point |
A Point |
Returns
- Point
Hit :Test Result A Point
Hit containing the hit test result.Test Result
HitTest(PointHitTestParameters, Func<IUIElement, PointHitTestParameters, bool>)
Hit tests to find the IUIElement that contains the specified coordinates.
Parameter | Type | Description |
---|---|---|
hitTestParams | Point |
A Point |
filter | Func<IUIElement, Point |
Optionally defines a filter which must return |
Returns
- Point
Hit :Test Result A Point
Hit containing the hit test result.Test Result
HitTestRecursive(PointHitTestParameters)
Recursively hit tests to find the IUIElement that contains the specified coordinates.
Parameter | Type | Description |
---|---|---|
hitTestParams | Point |
A Point |
Returns
- Point
Hit :Test Result A Point
Hit containing the hit test result.Test Result
HitTestRecursive(PointHitTestParameters, Func<IUIElement, PointHitTestParameters, bool>)
Recursively hit tests to find the IUIElement that contains the specified coordinates.
Parameter | Type | Description |
---|---|---|
hitTestParams | Point |
A Point |
filter | Func<IUIElement, Point |
Optionally defines a filter which must return |
Returns
- Point
Hit :Test Result A Point
Hit containing the hit test result.Test Result
Invalidate(InvalidationLevels, InvalidationTypes)
Invalidates the specified states for the element or its related elements.
Parameter | Type | Description |
---|---|---|
levels | Invalidation |
The hierarchy levels at which to invalidate. |
types | Invalidation |
The types of invalidation to perform. |
InvalidateArrange()
Invalidates the layout of the element.
InvalidateMeasure()
Invalidates the measurement of the element.
Measure(Graphics, Size)
Measures the element and updates the Desired
Parameter | Type | Description |
---|---|---|
g | Graphics | The Graphics object to use for measurement. |
availableSize | Size | The available size that parent can give to the child. The child can return bigger in hopes that the parent will become scrollable. The value may also be infinity to indicate that the desired measurements of the element are wanted. |
Remarks
The Measure(Graphics, Size) method should be called by parents on their children.
Internally, Measure(Graphics, Size) calls the MeasureCore
override on the same object,
giving it opportunity to compute its DesiredavailableSize
is the same as cached.
This method also resets the Is
NotifyChildDesiredSizeChanged()
Notifies that a child object's desired size has changed.
NotifyMouseLeaveEvent()
Notifies the object of a a mouse leave event.
Remarks
This enables the object to cancel hot state tracking.
Render(PaintEventArgs)
Renders the element.
Parameter | Type | Description |
---|---|---|
e | Paint |
A Paint |
TransformToAncestor(IUIElement)
Returns a General
Parameter | Type | Description |
---|---|---|
ancestor | IUIElement | The ancestor IUIElement. |
Returns
- General
Transform : A General
Transform from this element to a ancestor element.
TransformToDescendant(IUIElement)
Returns a General
Parameter | Type | Description |
---|---|---|
descendant | IUIElement | The descendant IUIElement. |
Returns
- General
Transform : A General
Transform from this element to a descendant element.
Inherited Members
-
ILogical
Tree Node. Find Ancestor(Type) -
ILogical
Tree Node. Get Common Ancestor(ILogical Tree Node) -
ILogical
Tree Node. Is Ancestor Of(ILogical Tree Node) -
ILogical
Tree Node. Is Descendant Of(ILogical Tree Node) -
ILogical
Tree Node. Children -
ILogical
Tree Node. Parent -
IDpi
Aware Element. Dpi Scale Changed(Size F) -
IDpi
Aware Element. Dpi Scale Factor -
IDisposable.
Dispose()
Extension Methods
-
Dpi
Aware Element Extensions. Auto Scale Font(IDpi Aware Element, Font) -
Dpi
Aware Element Extensions. Auto Scale Font Size(IDpi Aware Element, float) -
Dpi
Aware Element Extensions. Scale Logical Value(IDpi Aware Element, Padding) -
Dpi
Aware Element Extensions. Scale Logical Value(IDpi Aware Element, Point) -
Dpi
Aware Element Extensions. Scale Logical Value(IDpi Aware Element, Rectangle) -
Dpi
Aware Element Extensions. Scale Logical Value(IDpi Aware Element, Size) -
Dpi
Aware Element Extensions. Scale Logical Value(IDpi Aware Element, Size F) -
Dpi
Aware Element Extensions. Scale Logical Value(IDpi Aware Element, int) -
Dpi
Aware Element Extensions. Scale Logical Value(IDpi Aware Element, float) -
Dpi
Aware Element Extensions. Scale Logical Value(IDpi Aware Element, Padding) -
Dpi
Aware Element Extensions. Synchronize Scale Factor With Children(IDpi Aware Element)