Class DateTimePickerPanel
- Namespace
- Avalonia.Controls.Primitives
- Assembly
- Avalonia.Controls.dll
public class DateTimePickerPanel : Panel, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue, IChildIndexProvider, ILogicalScrollable, IScrollable
- Inheritance
-
DateTimePickerPanel
- Implements
- Inherited Members
- Extension Methods
Constructors
DateTimePickerPanel()
public DateTimePickerPanel()
Fields
ItemFormatProperty
Defines the ItemFormat property
public static readonly StyledProperty<string> ItemFormatProperty
Field Value
ItemHeightProperty
Defines the ItemHeight property
public static readonly StyledProperty<double> ItemHeightProperty
Field Value
PanelTypeProperty
Defines the PanelType property
public static readonly StyledProperty<DateTimePickerPanelType> PanelTypeProperty
Field Value
ShouldLoopProperty
Defines the ShouldLoop property
public static readonly StyledProperty<bool> ShouldLoopProperty
Field Value
Properties
CanHorizontallyScroll
Gets or sets a value indicating whether the content can be scrolled horizontally.
public bool CanHorizontallyScroll { get; set; }
Property Value
CanVerticallyScroll
Gets or sets a value indicating whether the content can be scrolled horizontally.
public bool CanVerticallyScroll { get; set; }
Property Value
Extent
Gets the extent of the scrollable content, in logical units
public Size Extent { get; }
Property Value
Increment
Gets or sets the increment
public int Increment { get; set; }
Property Value
IsLogicalScrollEnabled
Gets a value indicating whether logical scrolling is enabled on the control.
public bool IsLogicalScrollEnabled { get; }
Property Value
ItemFormat
Gets or sets the string format for the items, using standard .net DateTime or TimeSpan formatting. Format must match panel type
public string ItemFormat { get; set; }
Property Value
ItemHeight
Gets or sets the height of each item
public double ItemHeight { get; set; }
Property Value
MaximumValue
Gets or sets the maximum value
public int MaximumValue { get; set; }
Property Value
MinimumValue
Gets or sets the minimum value
public int MinimumValue { get; set; }
Property Value
Offset
Gets or sets the current scroll offset, in logical units.
public Vector Offset { get; set; }
Property Value
PageScrollSize
Gets the size to page by, in logical units.
public Size PageScrollSize { get; }
Property Value
PanelType
Gets or sets what this panel displays in date or time units
public DateTimePickerPanelType PanelType { get; set; }
Property Value
ScrollSize
Gets the size to scroll by, in logical units.
public Size ScrollSize { get; }
Property Value
SelectedValue
Gets or sets the selected value
public int SelectedValue { get; set; }
Property Value
ShouldLoop
Gets or sets whether the panel should loop
public bool ShouldLoop { get; set; }
Property Value
Viewport
Gets the size of the viewport, in logical units.
public Size Viewport { get; }
Property Value
Methods
ArrangeOverride(Size)
Positions child elements as part of a layout pass.
protected override Size ArrangeOverride(Size finalSize)
Parameters
finalSize
SizeThe size available to the control.
Returns
- Size
The actual size used.
BringIntoView(Control, Rect)
Attempts to bring a portion of the target visual into view by scrolling the content.
public bool BringIntoView(Control target, Rect targetRect)
Parameters
target
ControlThe target visual.
targetRect
RectThe portion of the target visual to bring into view.
Returns
- bool
True if the scroll offset was changed; otherwise false.
GetControlInDirection(NavigationDirection, Control?)
Gets the next control in the specified direction.
public Control? GetControlInDirection(NavigationDirection direction, Control? from)
Parameters
direction
NavigationDirectionThe movement direction.
from
ControlThe control from which movement begins.
Returns
- Control
The control.
MeasureOverride(Size)
Measures the control and its child elements as part of a layout pass.
protected override Size MeasureOverride(Size availableSize)
Parameters
availableSize
SizeThe size available to the control.
Returns
- Size
The desired size for the control.
OnAttachedToVisualTree(VisualTreeAttachmentEventArgs)
Called when the control is added to a rooted visual tree.
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
Parameters
e
VisualTreeAttachmentEventArgsThe event args.
OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs)
Called when the control is removed from a rooted visual tree.
protected override void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e)
Parameters
e
VisualTreeAttachmentEventArgsThe event args.
OnKeyDown(KeyEventArgs)
Called before the KeyDown event occurs.
protected override void OnKeyDown(KeyEventArgs e)
Parameters
e
KeyEventArgsThe event args.
RaiseScrollInvalidated(EventArgs)
Raises the ScrollInvalidated event.
public void RaiseScrollInvalidated(EventArgs e)
Parameters
e
EventArgsThe event args.
RefreshItems()
Refreshes the content of the visible items
public void RefreshItems()
ScrollDown(int)
Scrolls down the specified number of items
public void ScrollDown(int numItems = 1)
Parameters
numItems
int
ScrollUp(int)
Scrolls up the specified number of items
public void ScrollUp(int numItems = 1)
Parameters
numItems
int
Events
ScrollInvalidated
Raised when the scroll is invalidated.
public event EventHandler? ScrollInvalidated
Event Type
Remarks
This event notifies an attached ScrollViewer of a change in one of the scroll properties.
SelectionChanged
public event EventHandler? SelectionChanged