Class UIElement
Assembly: nanoFramework.Graphics.dll
Syntax
public abstract class UIElement : DispatcherObject
Constructors
|
Improve this Doc
View Source
UIElement()
Declaration
Fields
|
Improve this Doc
View Source
_horizontalAlignment
Declaration
protected HorizontalAlignment _horizontalAlignment
Field Value
|
Improve this Doc
View Source
_verticalAlignment
Declaration
protected VerticalAlignment _verticalAlignment
Field Value
Properties
|
Improve this Doc
View Source
ActualHeight
Declaration
public int ActualHeight { get; }
Property Value
|
Improve this Doc
View Source
ActualWidth
Declaration
public int ActualWidth { get; }
Property Value
|
Improve this Doc
View Source
Height
Declaration
public int Height { get; set; }
Property Value
|
Improve this Doc
View Source
HorizontalAlignment
Declaration
public HorizontalAlignment HorizontalAlignment { get; set; }
Property Value
|
Improve this Doc
View Source
InstanceEventHandlersStore
Ensure the store has been created.
Declaration
protected Hashtable InstanceEventHandlersStore { get; }
Property Value
|
Improve this Doc
View Source
IsArrangeValid
Determines if the RenderSize and position of child elements is valid.
Declaration
public bool IsArrangeValid { get; }
Property Value
|
Improve this Doc
View Source
IsEnabled
Fetches the value of the IsEnabled property
Declaration
public bool IsEnabled { get; set; }
Property Value
|
Improve this Doc
View Source
IsFocused
A property indicating if the button is focused on this
element or not.
Declaration
public bool IsFocused { get; }
Property Value
|
Improve this Doc
View Source
IsMeasureValid
Determines if the DesiredSize is valid.
Declaration
public bool IsMeasureValid { get; }
Property Value
|
Improve this Doc
View Source
IsVisible
A property indicating if this element is Visible or not.
Declaration
public bool IsVisible { get; }
Property Value
|
Improve this Doc
View Source
LogicalChildren
Declaration
protected UIElementCollection LogicalChildren { get; }
Property Value
|
Improve this Doc
View Source
Parent
Declaration
public UIElement Parent { get; }
Property Value
|
Improve this Doc
View Source
RootUIElement
Declaration
public UIElement RootUIElement { get; }
Property Value
|
Improve this Doc
View Source
VerticalAlignment
Declaration
public VerticalAlignment VerticalAlignment { get; set; }
Property Value
|
Improve this Doc
View Source
Visibility
Declaration
public Visibility Visibility { get; set; }
Property Value
|
Improve this Doc
View Source
Width
Declaration
public int Width { get; set; }
Property Value
Methods
|
Improve this Doc
View Source
AddHandler(RoutedEvent, RoutedEventHandler, Boolean)
Adds a routed event handler for the particular
RoutedEvent
Declaration
public void AddHandler(RoutedEvent routedEvent, RoutedEventHandler handler, bool handledEventsToo)
Parameters
Type |
Name |
Description |
RoutedEvent |
routedEvent |
RoutedEvent for which the handler
is attached
|
RoutedEventHandler |
handler |
The handler that will be invoked on this object
when the RoutedEvent is raised
|
Boolean |
handledEventsToo |
Flag indicating whether or not the listener wants to
hear about events that have already been handled
|
Remarks
|
Improve this Doc
View Source
AddToEventRoute(EventRoute, RoutedEventArgs)
Add the event handlers for this element to the route.
Declaration
public void AddToEventRoute(EventRoute route, RoutedEventArgs args)
Parameters
|
Improve this Doc
View Source
Arrange(Int32, Int32, Int32, Int32)
Parents or system call this method to arrange the internals of children on a second pass of layout update.
Declaration
public void Arrange(int finalRectX, int finalRectY, int finalRectWidth, int finalRectHeight)
Parameters
Type |
Name |
Description |
Int32 |
finalRectX |
This is the final X location that parent or system wants this UIElement to assume.
|
Int32 |
finalRectY |
This is the final Y location that parent or system wants this UIElement to assume.
|
Int32 |
finalRectWidth |
This is the Width that parent or system wants this UIElement to assume.
|
Int32 |
finalRectHeight |
This is the height that parent or system wants this UIElement to assume.
|
|
Improve this Doc
View Source
ArrangeOverride(Int32, Int32)
ArrangeOverride allows for the customization of the final sizing and positioning of children.
Declaration
protected virtual void ArrangeOverride(int arrangeWidth, int arrangeHeight)
Parameters
Type |
Name |
Description |
Int32 |
arrangeWidth |
Final width
|
Int32 |
arrangeHeight |
Final height
|
|
Improve this Doc
View Source
ChildElementFromPoint(Int32, Int32)
Given x, y co-ordinates of the parent UIElement,
find the child control that is directly underneath that point.
If there are multiple such controls, the one that was created/inserted
into the list last wins. This is because we don't have explicit z-ordering
right now.
Declaration
public UIElement ChildElementFromPoint(int x, int y)
Parameters
Returns
|
Improve this Doc
View Source
ContainsPoint(Int32, Int32)
Declaration
public bool ContainsPoint(int x, int y)
Parameters
Returns
|
Improve this Doc
View Source
GetDesiredSize(out Int32, out Int32)
Declaration
public void GetDesiredSize(out int width, out int height)
Parameters
|
Improve this Doc
View Source
GetLayoutOffset(out Int32, out Int32)
Declaration
public void GetLayoutOffset(out int x, out int y)
Parameters
|
Improve this Doc
View Source
GetMargin(out Int32, out Int32, out Int32, out Int32)
Declaration
public void GetMargin(out int left, out int top, out int right, out int bottom)
Parameters
|
Improve this Doc
View Source
GetPointerTarget(Int32, Int32)
Declaration
public UIElement GetPointerTarget(int x, int y)
Parameters
Returns
|
Improve this Doc
View Source
GetRenderSize(out Int32, out Int32)
Declaration
public void GetRenderSize(out int width, out int height)
Parameters
|
Improve this Doc
View Source
GetUnclippedSize(out Int32, out Int32)
Declaration
public void GetUnclippedSize(out int width, out int height)
Parameters
|
Improve this Doc
View Source
Invalidate()
Declaration
|
Improve this Doc
View Source
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.
Declaration
public void InvalidateArrange()
|
Improve this Doc
View Source
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.
Declaration
public void InvalidateMeasure()
|
Improve this Doc
View Source
InvalidateRect(Int32, Int32, Int32, Int32)
Declaration
public void InvalidateRect(int x, int y, int w, int h)
Parameters
|
Improve this Doc
View Source
Measure(Int32, Int32)
Updates DesiredSize of the UIElement. Must be called by parents from their MeasureOverride, to form recursive update.
This is first pass of layout update.
Declaration
public void Measure(int availableWidth, int availableHeight)
Parameters
Type |
Name |
Description |
Int32 |
availableWidth |
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...
|
Int32 |
availableHeight |
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...
|
|
Improve this Doc
View Source
MeasureOverride(Int32, Int32, out Int32, out Int32)
Measurement override. Implement your size-to-content logic here.
Declaration
protected virtual void MeasureOverride(int availableWidth, int availableHeight, out int desiredWidth, out int desiredHeight)
Parameters
Type |
Name |
Description |
Int32 |
availableWidth |
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...
|
Int32 |
availableHeight |
|
Int32 |
desiredWidth |
|
Int32 |
desiredHeight |
|
|
Improve this Doc
View Source
Declaration
protected virtual void OnButtonDown(ButtonEventArgs e)
Parameters
|
Improve this Doc
View Source
Declaration
protected virtual void OnButtonUp(ButtonEventArgs e)
Parameters
|
Improve this Doc
View Source
OnChildDesiredSizeChanged(UIElement)
Notification that is called by Measure of a child when
it ends up with different desired size for the child.
Declaration
protected virtual void OnChildDesiredSizeChanged(UIElement child)
Parameters
|
Improve this Doc
View Source
OnChildrenChanged(UIElement, UIElement, Int32)
OnChildrenChanged is called when the UIElementCollection of the UIElement is edited.
Declaration
protected virtual void OnChildrenChanged(UIElement added, UIElement removed, int indexAffected)
Parameters
|
Improve this Doc
View Source
Declaration
protected virtual void OnGenericEvent(GenericEventArgs e)
Parameters
|
Improve this Doc
View Source
Declaration
protected virtual void OnGotFocus(FocusChangedEventArgs e)
Parameters
|
Improve this Doc
View Source
Declaration
protected virtual void OnLostFocus(FocusChangedEventArgs e)
Parameters
|
Improve this Doc
View Source
Declaration
protected virtual void OnPreviewButtonDown(ButtonEventArgs e)
Parameters
|
Improve this Doc
View Source
Declaration
protected virtual void OnPreviewButtonUp(ButtonEventArgs e)
Parameters
|
Improve this Doc
View Source
OnRender(DrawingContext)
Declaration
public virtual void OnRender(DrawingContext dc)
Parameters
|
Improve this Doc
View Source
Declaration
protected virtual void OnTouchDown(TouchEventArgs e)
Parameters
|
Improve this Doc
View Source
OnTouchGestureChanged(TouchGestureEventArgs)
Declaration
protected virtual void OnTouchGestureChanged(TouchGestureEventArgs e)
Parameters
|
Improve this Doc
View Source
OnTouchGestureEnded(TouchGestureEventArgs)
Declaration
protected virtual void OnTouchGestureEnded(TouchGestureEventArgs e)
Parameters
|
Improve this Doc
View Source
OnTouchGestureStarted(TouchGestureEventArgs)
Declaration
protected virtual void OnTouchGestureStarted(TouchGestureEventArgs e)
Parameters
|
Improve this Doc
View Source
Declaration
protected virtual void OnTouchMove(TouchEventArgs e)
Parameters
|
Improve this Doc
View Source
Declaration
protected virtual void OnTouchUp(TouchEventArgs e)
Parameters
|
Improve this Doc
View Source
PointToClient(ref Int32, ref Int32)
Declaration
public void PointToClient(ref int x, ref int y)
Parameters
|
Improve this Doc
View Source
PointToScreen(ref Int32, ref Int32)
We are deviating little from their desktop counter parts, mostly for simplicity and perf.
Declaration
public void PointToScreen(ref int x, ref int y)
Parameters
|
Improve this Doc
View Source
RaiseEvent(RoutedEventArgs)
Declaration
public void RaiseEvent(RoutedEventArgs args)
Parameters
|
Improve this Doc
View Source
RenderRecursive(DrawingContext)
Declaration
protected virtual void RenderRecursive(DrawingContext dc)
Parameters
|
Improve this Doc
View Source
SetMargin(Int32)
Declaration
public void SetMargin(int length)
Parameters
Type |
Name |
Description |
Int32 |
length |
|
|
Improve this Doc
View Source
SetMargin(Int32, Int32, Int32, Int32)
Declaration
public void SetMargin(int left, int top, int right, int bottom)
Parameters
|
Improve this Doc
View Source
UpdateLayout()
Call this method to ensure that the whoel subtree of elements that includes this UIElement
is properly updated.
Declaration
public void UpdateLayout()
Events
|
Improve this Doc
View Source
IsEnabledChanged
Declaration
public event PropertyChangedEventHandler IsEnabledChanged
Event Type
|
Improve this Doc
View Source
IsVisibleChanged
Declaration
public event PropertyChangedEventHandler IsVisibleChanged
Event Type
|
Improve this Doc
View Source
TouchDown
Declaration
public event TouchEventHandler TouchDown
Event Type
|
Improve this Doc
View Source
TouchGestureChanged
Declaration
public event TouchGestureEventHandler TouchGestureChanged
Event Type
|
Improve this Doc
View Source
TouchGestureEnd
Declaration
public event TouchGestureEventHandler TouchGestureEnd
Event Type
|
Improve this Doc
View Source
TouchGestureStart
Declaration
public event TouchGestureEventHandler TouchGestureStart
Event Type
|
Improve this Doc
View Source
TouchMove
Declaration
public event TouchEventHandler TouchMove
Event Type
|
Improve this Doc
View Source
TouchUp
Declaration
public event TouchEventHandler TouchUp
Event Type
Extension Methods