UIElement Class
Namespace: GHIElectronics.TinyCLR.UI · Assembly: GHIElectronics.TinyCLR.UI
No description available.
public abstract class UIElement : DispatcherObject
Constructors
UIElement()
protected UIElement()
No description available.
Properties
ActualWidth
public int ActualWidth { get; }
No description available.
ActualHeight
public int ActualHeight { get; }
No description available.
Height
public int Height { get; set; }
Frame height in pixels. (inherited)
Width
public int Width { get; set; }
Column width in pixels. (inherited)
LogicalChildren
protected internal UIElementCollection LogicalChildren { get; }
No description available.
IsFocused
public bool IsFocused { get; }
A property indicating if the button is focused on this element or not.
IsMeasureValid
public bool IsMeasureValid { get; }
Determines if the DesiredSize is valid.
IsArrangeValid
public bool IsArrangeValid { get; }
Determines if the RenderSize and position of child elements is valid.
Parent
public UIElement Parent { get; }
No description available.
RootUIElement
public UIElement RootUIElement { get; }
No description available.
HorizontalAlignment
public HorizontalAlignment HorizontalAlignment { get; set; }
No description available.
VerticalAlignment
public VerticalAlignment VerticalAlignment { get; set; }
No description available.
Visibility
public Visibility Visibility { get; set; }
Visibility accessor
IsVisible
public bool IsVisible { get; }
A property indicating if this element is Visible or not.
IsEnabled
public bool IsEnabled { get; set; }
Fetches the value of the IsEnabled property
Methods
OnGenericEvent(GenericEventArgs e)
protected virtual void OnGenericEvent(GenericEventArgs e)
No description available.
| Parameter | Type | Description |
|---|---|---|
e | GenericEventArgs |
OnTouchDown(TouchEventArgs e)
protected virtual void OnTouchDown(TouchEventArgs e)
Handles the touch down event. (inherited)
| Parameter | Type | Description |
|---|---|---|
e | TouchEventArgs | Touch event arguments. |
OnTouchUp(TouchEventArgs e)
protected virtual void OnTouchUp(TouchEventArgs e)
Handles the touch up event. (inherited)
| Parameter | Type | Description |
|---|---|---|
e | TouchEventArgs | Touch event arguments. |
OnTouchMove(TouchEventArgs e)
protected virtual void OnTouchMove(TouchEventArgs e)
Handles the touch move event. (inherited)
| Parameter | Type | Description |
|---|---|---|
e | TouchEventArgs | Touch event arguments. |
OnTouchGestureStarted(TouchGestureEventArgs e)
protected virtual void OnTouchGestureStarted(TouchGestureEventArgs e)
No description available.
| Parameter | Type | Description |
|---|---|---|
e | TouchGestureEventArgs |
OnTouchGestureChanged(TouchGestureEventArgs e)
protected virtual void OnTouchGestureChanged(TouchGestureEventArgs e)
No description available.
| Parameter | Type | Description |
|---|---|---|
e | TouchGestureEventArgs |
OnTouchGestureEnded(TouchGestureEventArgs e)
protected virtual void OnTouchGestureEnded(TouchGestureEventArgs e)
No description available.
| Parameter | Type | Description |
|---|---|---|
e | TouchGestureEventArgs |
OnPreviewButtonDown(ButtonEventArgs e)
protected virtual void OnPreviewButtonDown(ButtonEventArgs e)
An event reporting a button was pressed.
| Parameter | Type | Description |
|---|---|---|
e | ButtonEventArgs |
OnButtonDown(ButtonEventArgs e)
protected virtual void OnButtonDown(ButtonEventArgs e)
An event reporting a button was pressed.
| Parameter | Type | Description |
|---|---|---|
e | ButtonEventArgs |
OnPreviewButtonUp(ButtonEventArgs e)
protected virtual void OnPreviewButtonUp(ButtonEventArgs e)
An event reporting a button was released.
| Parameter | Type | Description |
|---|---|---|
e | ButtonEventArgs |
OnButtonUp(ButtonEventArgs e)
protected virtual void OnButtonUp(ButtonEventArgs e)
An event reporting a button was released.
| Parameter | Type | Description |
|---|---|---|
e | ButtonEventArgs |
OnGotFocus(FocusChangedEventArgs e)
protected virtual void OnGotFocus(FocusChangedEventArgs e)
An event announcing that the buttons are focused on this element.
| Parameter | Type | Description |
|---|---|---|
e | FocusChangedEventArgs |
OnLostFocus(FocusChangedEventArgs e)
protected virtual void OnLostFocus(FocusChangedEventArgs e)
An event announcing that the buttons is no longer focused on this element
| Parameter | Type | Description |
|---|---|---|
e | FocusChangedEventArgs |
GetDesiredSize(out int width, out int height)
public void GetDesiredSize(out int width, out int height)
No description available.
| Parameter | Type | Description |
|---|---|---|
width | out int | |
height | out int |
GetMargin(out int left, out int top, out int right, out int bottom)
public void GetMargin(out int left, out int top, out int right, out int bottom)
No description available.
| Parameter | Type | Description |
|---|---|---|
left | out int | |
top | out int | |
right | out int | |
bottom | out int |
SetMargin(int length)
public void SetMargin(int length)
No description available.
| Parameter | Type | Description |
|---|---|---|
length | int |
SetMargin(int left, int top, int right, int bottom)
public void SetMargin(int left, int top, int right, int bottom)
No description available.
| Parameter | Type | Description |
|---|---|---|
left | int | |
top | int | |
right | int | |
bottom | int |
IsHeightSet(out int height)
protected internal bool IsHeightSet(out int height)
No description available.
| Parameter | Type | Description |
|---|---|---|
height | out int |
Returns bool
IsWidthSet(out int width)
protected internal bool IsWidthSet(out int width)
No description available.
| Parameter | Type | Description |
|---|---|---|
width | out int |
Returns bool
GetLayoutOffset(out int x, out int y)
public void GetLayoutOffset(out int x, out int y)
No description available.
| Parameter | Type | Description |
|---|---|---|
x | out int | |
y | out int |
GetRenderSize(out int width, out int height)
public void GetRenderSize(out int width, out int height)
No description available.
| Parameter | Type | Description |
|---|---|---|
width | out int | |
height | out int |
OnChildrenChanged(UIElement added, UIElement removed, int indexAffected)
protected internal virtual void OnChildrenChanged( UIElement added, UIElement removed, int indexAffected)
OnChildrenChanged is called when the UIElementCollection of the UIElement is edited.
| Parameter | Type | Description |
|---|---|---|
added | UIElement | |
removed | UIElement | |
indexAffected | int |
Measure(int availableWidth, int availableHeight)
public void Measure(int availableWidth, int availableHeight)
Updates DesiredSize of the UIElement. Must be called by parents from their MeasureOverride, to form recursive update. This is first pass of layout update.
| Parameter | Type | Description |
|---|---|---|
availableWidth | int | Available width that parent can give to the child. May be MaxValue (when parent wants to measure to content). This is soft constraint. Child can return bigger size to indicate that it wants bigger space and hope that parent can throw in scrolling... |
availableHeight | int | Available height that parent can give to the child. May be MaxValue (when parent wants to measure to content). This is soft constraint. Child can return bigger size to indicate that it wants bigger space and hope that parent can throw in scrolling... |
Arrange(int finalRectX, int finalRectY, int finalRectWidth, int finalRectHeight)
public void Arrange(int finalRectX, int finalRectY, int finalRectWidth, int finalRectHeight)
No description available.
| Parameter | Type | Description |
|---|---|---|
finalRectX | int | |
finalRectY | int | |
finalRectWidth | int | |
finalRectHeight | int |
MeasureOverride(int availableWidth, int availableHeight, out int desiredWidth, out int desiredHeight)
protected virtual void MeasureOverride(int availableWidth, int availableHeight, out int desiredWidth, out int desiredHeight)
Measurement override. Implement your size-to-content logic here.
| Parameter | Type | Description |
|---|---|---|
availableWidth | int | Available size that parent can give to the child. May be MaxValue(when parent wants to measure to content). This is soft constraint. Child can return bigger size to indicate that it wants bigger space and hope that parent can throw in scrolling... |
availableHeight | int | |
desiredWidth | out int | |
desiredHeight | out int |
ArrangeOverride(int arrangeWidth, int arrangeHeight)
protected virtual void ArrangeOverride(int arrangeWidth, int arrangeHeight)
ArrangeOverride allows for the customization of the final sizing and positioning of children.
| Parameter | Type | Description |
|---|---|---|
arrangeWidth | int | Final width |
arrangeHeight | int | Final height |
UpdateLayout()
public void UpdateLayout()
Call this method to ensure that the whoel subtree of elements that includes this UIElement is properly updated.
ChildElementFromPoint(int x, int y)
public UIElement ChildElementFromPoint(int x, int y)
No description available.
| Parameter | Type | Description |
|---|---|---|
x | int | |
y | int |
Returns UIElement
GetUnclippedSize(out int width, out int height)
public void GetUnclippedSize(out int width, out int height)
No description available.
| Parameter | Type | Description |
|---|---|---|
width | out int | |
height | out int |
ContainsPoint(int x, int y)
public bool ContainsPoint(int x, int y)
No description available.
| Parameter | Type | Description |
|---|---|---|
x | int | |
y | int |
Returns bool
GetPointerTarget(int x, int y)
public UIElement GetPointerTarget(int x, int y)
No description available.
| Parameter | Type | Description |
|---|---|---|
x | int | |
y | int |
Returns UIElement
PointToScreen(ref int x, ref int y)
public void PointToScreen(ref int x, ref int y)
We are deviating little from their desktop counter parts, mostly for simplicity and perf.
| Parameter | Type | Description |
|---|---|---|
x | ref int | |
y | ref int |
PointToClient(ref int x, ref int y)
public void PointToClient(ref int x, ref int y)
No description available.
| Parameter | Type | Description |
|---|---|---|
x | ref int | |
y | ref int |
InvalidateMeasure()
public void InvalidateMeasure()
Invalidates the measurement state for the UIElement. This has the effect of also invalidating the arrange state for the UIElement. The UIElement will be queued for an update layout that will occur asynchronously.
InvalidateArrange()
public void InvalidateArrange()
Invalidates the arrange state for the UIElement. The UIElement will be queued for an update layout that will occur asynchronously. MeasureOverride will not be called unless InvalidateMeasure is also called - or that something else caused the measure state to be invalidated.
OnChildDesiredSizeChanged(UIElement child)
protected virtual void OnChildDesiredSizeChanged(UIElement child)
Notification that is called by Measure of a child when it ends up with different desired size for the child.
| Parameter | Type | Description |
|---|---|---|
child | UIElement |
OnRender(DrawingContext dc)
public virtual void OnRender(DrawingContext dc)
Renders the DataGrid onto it's parent container's graphics. (inherited)
| Parameter | Type | Description |
|---|---|---|
dc | DrawingContext |
RenderRecursive(DrawingContext dc)
protected internal virtual void RenderRecursive(DrawingContext dc)
No description available.
| Parameter | Type | Description |
|---|---|---|
dc | DrawingContext |
InvalidateRect(int x, int y, int w, int h)
public void InvalidateRect(int x, int y, int w, int h)
No description available.
| Parameter | Type | Description |
|---|---|---|
x | int | |
y | int | |
w | int | |
h | int |
Invalidate()
public void Invalidate()
No description available.
AddToEventRoute(EventRoute route, RoutedEventArgs args)
public void AddToEventRoute(EventRoute route, RoutedEventArgs args)
No description available.
| Parameter | Type | Description |
|---|---|---|
route | EventRoute | |
args | RoutedEventArgs |
AddHandler(RoutedEvent routedEvent, RoutedEventHandler handler, bool handledEventsToo)
public void AddHandler( RoutedEvent routedEvent, RoutedEventHandler handler, bool handledEventsToo)
Adds a routed event handler for the particular RoutedEvent
| Parameter | Type | Description |
|---|---|---|
routedEvent | RoutedEvent | RoutedEvent for which the handler is attached |
handler | RoutedEventHandler | The handler that will be invoked on this object when the RoutedEvent is raised |
handledEventsToo | bool | Flag indicating whether or not the listener wants to hear about events that have already been handled |
PrintSize(int x, int y)
public static string PrintSize(int x, int y)
No description available.
| Parameter | Type | Description |
|---|---|---|
x | int | |
y | int |
Returns string
Events
TouchUp
public event TouchEventHandler TouchUp
No description available.
TouchMove
public event TouchEventHandler TouchMove
No description available.
TouchGestureStart
public event TouchGestureEventHandler TouchGestureStart
No description available.
TouchGestureChanged
public event TouchGestureEventHandler TouchGestureChanged
No description available.
TouchGestureEnd
public event TouchGestureEventHandler TouchGestureEnd
No description available.
IsVisibleChanged
public event PropertyChangedEventHandler IsVisibleChanged
No description available.
IsEnabledChanged
public event PropertyChangedEventHandler IsEnabledChanged
No description available.
Fields
_horizontalAlignment
protected HorizontalAlignment _horizontalAlignment
No description available.
_verticalAlignment
protected VerticalAlignment _verticalAlignment
No description available.