View
- Kind: Class
- Namespace: SkeleKit
Constructors
Applies the app's implicit theme styles for this view's type.
Properties
AccessibilityHint
Extra VoiceOver context describing what activating the view does, or null for none.
Type: string?
AccessibilityIdentifier
Identifier for UI tests. Never read to the user.
Type: string?
AccessibilityLabel
Text VoiceOver reads for the view, or null for the control's own default.
AccessibilityTraits
Extra traits VoiceOver applies on top of the control's own (Header, Selected, ...).
Type: AccessibilityTraits
AccessibilityValue
The current value VoiceOver reads after the label (a slider's percentage), or null for the control's own default.
AnchorPoint
The pivot for Rotation and Scale, in unit coordinates.
(0.5, 0.5) is the center (the default), (0, 0) the top-left corner, (1, 1) the bottom-right.
Type: Point
ArrangedBounds
Frame from the last arrange pass, in the parent's coordinates (margin excluded).
Type: Rect
Background
The background fill: a color, gradient or material, or null for transparent.
Type: Brush?
BindingContext
The object bindings resolve against. Inherited from the parent unless set explicitly.
Type: object?
ClipsToBounds
When true, content is clipped to the bounds and corner radius.
False by default so child shadows and effects can extend beyond layout bounds. Scrolling views clip by default because their bounds are a viewport.
Type: bool
ContextMenu
Entries in the view's long-press context menu. Empty for none.
Type: IList<MenuAction>
CornerRadius
Corner radius in points applied to the layer.
Type: double
DesiredSize
Size requested by the last measure pass, including Margin.
Type: Size
DoubleTapCommand
Command invoked when the view is double-tapped.
Type: ICommand?
DoubleTapCommandParameter
The parameter passed to DoubleTapCommand.
Type: object?
Haptics
The application's haptic feedback service.
ViewModels take
IHapticsby constructor instead.
Type: IHaptics
Height
Explicit height in points, or NaN to size to content.
This constrains layout bounds but does not imply clipping. Set
ClipsToBoundswhen children should not draw beyond an explicitly constrained container.
Type: double
HorizontalAlignment
How the view is placed within the horizontal space its parent gives it.
Type: HorizontalAlignment
IgnoresSafeArea
Edges this view is allowed to extend past the safe area.
A scrolling view still keeps its content inside it, so only the scroll passes under the bar.
Type: SafeAreaEdges
IsAccessibilityElement
Overrides whether VoiceOver treats the view as one element, or null for the control's own default.
Type: bool?
IsEnabled
Whether the view responds to touches.
IsFocused
Whether this view currently holds keyboard focus.
Type: bool
IsRealized
Whether the native view has been created yet.
Type: bool
IsVisible
When false the view takes no space and is hidden natively.
LongPressCommand
Command invoked when the view is held down for LongPressDuration.
Type: ICommand?
LongPressCommandParameter
The parameter passed to LongPressCommand.
Type: object?
LongPressDuration
How long a press must be held to count as a long press, in seconds.
Type: double
Margin
Empty space around the view, outside its bounds.
Type: Thickness
MaxHeight
Maximum height in points.
Type: double
MaxWidth
Maximum width in points.
Type: double
MinHeight
Minimum height in points.
Type: double
MinWidth
Minimum width in points.
Type: double
Native
The underlying UIKit view, created on first access. Primary escape hatch to UIKit.
Type: UIView
Navigator
The application's navigator.
ViewModels take
INavigatorby constructor instead.
Type: INavigator
Opacity
Opacity from 0 (transparent) to 1 (opaque).
Type: double
Panned
Invoked as the view is dragged.
Drive an
Animatorfrom it to make an animation interactive.
Type: Action<PanGesture>?
Parent
The panel this view sits in, or null when it is a root or unparented.
Type: View?
Pinched
Invoked as the view is pinched.
Feed the scale into
Scaleto zoom it.
Type: Action<PinchGesture>?
PointerEffect
The iPad pointer effect shown when a trackpad or mouse hovers this view, or None (the default).
Type: PointerEffect
Pressed
Invoked with true on touch-down anywhere in the view, false on release or cancel.
Child controls still receive their touches.
Rotated
Invoked as the view is rotated with two fingers.
Feed the degrees into
Rotationto turn it.
Type: Action<RotateGesture>?
Rotation
Rotates the view about its AnchorPoint, in degrees. Does not affect layout.
Type: double
Scale
Scales the view about its center, 1 being its laid-out size. Does not affect layout.
Type: double
Shadow
A drop shadow behind the view, or null for none.
Setting a shadow prevents
CornerRadiusfrom enabling clipping; an explicitClipsToBoundsstill hides it.
Type: Shadow?
Sharer
The application's share sheet.
ViewModels take
ISharerby constructor instead.
Type: ISharer
Style
A style applied the moment it is assigned.
Put it first in an object initializer; later assignments override it.
Type: IStyle?
SystemPicker
The application's photo and document pickers.
ViewModels take
ISystemPickerby constructor instead.
Type: ISystemPicker
TapCommand
Command invoked when the view is tapped.
Type: ICommand?
TapCommandParameter
The parameter passed to TapCommand.
Type: object?
Tint
The tint color for this view and everything under it.
Inherited from the parent unless set here, falling back to the app tint.
Type: Color?
Translation
Shifts the view from where layout put it, in points. Does not affect layout.
Type: Point
VerticalAlignment
How the view is placed within the vertical space its parent gives it.
Type: VerticalAlignment
Width
Explicit width in points, or NaN to size to content.
Type: double
Methods
AddNativeGesture
Adds a native gesture recognizer without forcing the view to realize.
This is an escape hatch for gestures the library does not wrap. The recognizer is retained and attached whenever the view's native peer is realized. The caller owns any separate target or delegate objects used by the recognizer.
| Parameter | Summary |
|---|---|
UIGestureRecognizer gesture | The native gesture recognizer to retain and attach. |
Animate
Animates the property changes made inside changes.
| Parameter | Summary |
|---|---|
double seconds | The animation duration, in seconds. |
Action changes | The property changes to animate. |
Animate
Animates the property changes made inside changes, following animation.
For an animation the user can grab mid-flight, create an
Animatorinstead.
| Parameter | Summary |
|---|---|
Animation animation | The timing and easing to use. |
Action changes | The property changes to animate. |
(optional) Action<bool>? completed | Called when the animation completes, with whether it finished normally. |
Arrange
Second pass: positions the view within its slot, honoring margin and alignment.
| Parameter | Summary |
|---|---|
Rect finalRect | The final slot in the parent's coordinates. |
ArrangeOverride
Content arrangement. Panels override to place their children.
| Parameter | Summary |
|---|---|
Size finalSize | The final size available for the view's content. |
Returns
Size: The arranged content size.
Focus
Gives the view keyboard focus, raising the keyboard for a text control. No-op until realized.
InvalidateMeasure
Drops the cached measurement here and up the tree, and asks the root host for a layout pass.
InvalidateSubtree
Drops every cached measurement in this subtree.
For changes that hit leaves directly, like a dynamic-type resize.
LayoutNow
Runs any pending layout right now. Call it inside an Animator's changes to animate a layout property.
Layout properties such as Width or Margin reach the native frame on the next layout pass, after an animation block closes. Calling this method inside the animation keeps them from snapping;
Animatedoes this automatically.
Measure
First pass: computes DesiredSize for the space the parent offers.
| Parameter | Summary |
|---|---|
Size available | The size available from the parent. |
MeasureOverride
Content measurement. Panels recurse; controls delegate to the native SizeThatFits.
| Parameter | Summary |
|---|---|
Size availableSize | The size available for the view's content. |
Returns
Size: The desired content size.
Realize
Builds the native view (if needed) and realizes children and bindings.
Returns
UIView: The realized native view.
Unfocus
Takes keyboard focus away, dismissing the keyboard.
Unrealize
Tears down the native view and children deterministically (no finalizers).