Table of Contents

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

StyledProperty<string>

ItemHeightProperty

Defines the ItemHeight property

public static readonly StyledProperty<double> ItemHeightProperty

Field Value

StyledProperty<double>

PanelTypeProperty

Defines the PanelType property

public static readonly StyledProperty<DateTimePickerPanelType> PanelTypeProperty

Field Value

StyledProperty<DateTimePickerPanelType>

ShouldLoopProperty

Defines the ShouldLoop property

public static readonly StyledProperty<bool> ShouldLoopProperty

Field Value

StyledProperty<bool>

Properties

CanHorizontallyScroll

Gets or sets a value indicating whether the content can be scrolled horizontally.

public bool CanHorizontallyScroll { get; set; }

Property Value

bool

CanVerticallyScroll

Gets or sets a value indicating whether the content can be scrolled horizontally.

public bool CanVerticallyScroll { get; set; }

Property Value

bool

Extent

Gets the extent of the scrollable content, in logical units

public Size Extent { get; }

Property Value

Size

Increment

Gets or sets the increment

public int Increment { get; set; }

Property Value

int

IsLogicalScrollEnabled

Gets a value indicating whether logical scrolling is enabled on the control.

public bool IsLogicalScrollEnabled { get; }

Property Value

bool

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

string

ItemHeight

Gets or sets the height of each item

public double ItemHeight { get; set; }

Property Value

double

MaximumValue

Gets or sets the maximum value

public int MaximumValue { get; set; }

Property Value

int

MinimumValue

Gets or sets the minimum value

public int MinimumValue { get; set; }

Property Value

int

Offset

Gets or sets the current scroll offset, in logical units.

public Vector Offset { get; set; }

Property Value

Vector

PageScrollSize

Gets the size to page by, in logical units.

public Size PageScrollSize { get; }

Property Value

Size

PanelType

Gets or sets what this panel displays in date or time units

public DateTimePickerPanelType PanelType { get; set; }

Property Value

DateTimePickerPanelType

ScrollSize

Gets the size to scroll by, in logical units.

public Size ScrollSize { get; }

Property Value

Size

SelectedValue

Gets or sets the selected value

public int SelectedValue { get; set; }

Property Value

int

ShouldLoop

Gets or sets whether the panel should loop

public bool ShouldLoop { get; set; }

Property Value

bool

Viewport

Gets the size of the viewport, in logical units.

public Size Viewport { get; }

Property Value

Size

Methods

ArrangeOverride(Size)

Positions child elements as part of a layout pass.

protected override Size ArrangeOverride(Size finalSize)

Parameters

finalSize Size

The 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 Control

The target visual.

targetRect Rect

The 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 NavigationDirection

The movement direction.

from Control

The 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 Size

The 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 VisualTreeAttachmentEventArgs

The event args.

OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs)

Called when the control is removed from a rooted visual tree.

protected override void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e)

Parameters

e VisualTreeAttachmentEventArgs

The event args.

OnKeyDown(KeyEventArgs)

Called before the KeyDown event occurs.

protected override void OnKeyDown(KeyEventArgs e)

Parameters

e KeyEventArgs

The event args.

RaiseScrollInvalidated(EventArgs)

Raises the ScrollInvalidated event.

public void RaiseScrollInvalidated(EventArgs e)

Parameters

e EventArgs

The 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

EventHandler

Remarks

This event notifies an attached ScrollViewer of a change in one of the scroll properties.

SelectionChanged

public event EventHandler? SelectionChanged

Event Type

EventHandler