Skip to main content

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.

ParameterTypeDescription
eGenericEventArgs

OnTouchDown(TouchEventArgs e)

protected virtual void OnTouchDown(TouchEventArgs e)

Handles the touch down event. (inherited)

ParameterTypeDescription
eTouchEventArgsTouch event arguments.

OnTouchUp(TouchEventArgs e)

protected virtual void OnTouchUp(TouchEventArgs e)

Handles the touch up event. (inherited)

ParameterTypeDescription
eTouchEventArgsTouch event arguments.

OnTouchMove(TouchEventArgs e)

protected virtual void OnTouchMove(TouchEventArgs e)

Handles the touch move event. (inherited)

ParameterTypeDescription
eTouchEventArgsTouch event arguments.

OnTouchGestureStarted(TouchGestureEventArgs e)

protected virtual void OnTouchGestureStarted(TouchGestureEventArgs e)

No description available.

ParameterTypeDescription
eTouchGestureEventArgs

OnTouchGestureChanged(TouchGestureEventArgs e)

protected virtual void OnTouchGestureChanged(TouchGestureEventArgs e)

No description available.

ParameterTypeDescription
eTouchGestureEventArgs

OnTouchGestureEnded(TouchGestureEventArgs e)

protected virtual void OnTouchGestureEnded(TouchGestureEventArgs e)

No description available.

ParameterTypeDescription
eTouchGestureEventArgs

OnPreviewButtonDown(ButtonEventArgs e)

protected virtual void OnPreviewButtonDown(ButtonEventArgs e)

An event reporting a button was pressed.

ParameterTypeDescription
eButtonEventArgs

OnButtonDown(ButtonEventArgs e)

protected virtual void OnButtonDown(ButtonEventArgs e)

An event reporting a button was pressed.

ParameterTypeDescription
eButtonEventArgs

OnPreviewButtonUp(ButtonEventArgs e)

protected virtual void OnPreviewButtonUp(ButtonEventArgs e)

An event reporting a button was released.

ParameterTypeDescription
eButtonEventArgs

OnButtonUp(ButtonEventArgs e)

protected virtual void OnButtonUp(ButtonEventArgs e)

An event reporting a button was released.

ParameterTypeDescription
eButtonEventArgs

OnGotFocus(FocusChangedEventArgs e)

protected virtual void OnGotFocus(FocusChangedEventArgs e)

An event announcing that the buttons are focused on this element.

ParameterTypeDescription
eFocusChangedEventArgs

OnLostFocus(FocusChangedEventArgs e)

protected virtual void OnLostFocus(FocusChangedEventArgs e)

An event announcing that the buttons is no longer focused on this element

ParameterTypeDescription
eFocusChangedEventArgs

GetDesiredSize(out int width, out int height)

public void GetDesiredSize(out int width, out int height)

No description available.

ParameterTypeDescription
widthout int
heightout 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.

ParameterTypeDescription
leftout int
topout int
rightout int
bottomout int

SetMargin(int length)

public void SetMargin(int length)

No description available.

ParameterTypeDescription
lengthint

SetMargin(int left, int top, int right, int bottom)

public void SetMargin(int left, int top, int right, int bottom)

No description available.

ParameterTypeDescription
leftint
topint
rightint
bottomint

IsHeightSet(out int height)

protected internal bool IsHeightSet(out int height)

No description available.

ParameterTypeDescription
heightout int

Returns bool

IsWidthSet(out int width)

protected internal bool IsWidthSet(out int width)

No description available.

ParameterTypeDescription
widthout int

Returns bool

GetLayoutOffset(out int x, out int y)

public void GetLayoutOffset(out int x, out int y)

No description available.

ParameterTypeDescription
xout int
yout int

GetRenderSize(out int width, out int height)

public void GetRenderSize(out int width, out int height)

No description available.

ParameterTypeDescription
widthout int
heightout 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.

ParameterTypeDescription
addedUIElement
removedUIElement
indexAffectedint

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.

ParameterTypeDescription
availableWidthintAvailable 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...
availableHeightintAvailable 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.

ParameterTypeDescription
finalRectXint
finalRectYint
finalRectWidthint
finalRectHeightint

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.

ParameterTypeDescription
availableWidthintAvailable 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...
availableHeightint
desiredWidthout int
desiredHeightout 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.

ParameterTypeDescription
arrangeWidthintFinal width
arrangeHeightintFinal 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.

ParameterTypeDescription
xint
yint

Returns UIElement

GetUnclippedSize(out int width, out int height)

public void GetUnclippedSize(out int width, out int height)

No description available.

ParameterTypeDescription
widthout int
heightout int

ContainsPoint(int x, int y)

public bool ContainsPoint(int x, int y)

No description available.

ParameterTypeDescription
xint
yint

Returns bool

GetPointerTarget(int x, int y)

public UIElement GetPointerTarget(int x, int y)

No description available.

ParameterTypeDescription
xint
yint

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.

ParameterTypeDescription
xref int
yref int

PointToClient(ref int x, ref int y)

public void PointToClient(ref int x, ref int y)

No description available.

ParameterTypeDescription
xref int
yref 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.

ParameterTypeDescription
childUIElement

OnRender(DrawingContext dc)

public virtual void OnRender(DrawingContext dc)

Renders the DataGrid onto it's parent container's graphics. (inherited)

ParameterTypeDescription
dcDrawingContext

RenderRecursive(DrawingContext dc)

protected internal virtual void RenderRecursive(DrawingContext dc)

No description available.

ParameterTypeDescription
dcDrawingContext

InvalidateRect(int x, int y, int w, int h)

public void InvalidateRect(int x, int y, int w, int h)

No description available.

ParameterTypeDescription
xint
yint
wint
hint

Invalidate()

public void Invalidate()

No description available.

AddToEventRoute(EventRoute route, RoutedEventArgs args)

public void AddToEventRoute(EventRoute route, RoutedEventArgs args)

No description available.

ParameterTypeDescription
routeEventRoute
argsRoutedEventArgs

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

ParameterTypeDescription
routedEventRoutedEventRoutedEvent for which the handler is attached
handlerRoutedEventHandlerThe handler that will be invoked on this object when the RoutedEvent is raised
handledEventsTooboolFlag 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.

ParameterTypeDescription
xint
yint

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.