Table of Contents

Class DatePickerPresenter

Namespace
Avalonia.Controls
Assembly
Avalonia.Controls.dll

Defines the presenter used for selecting a date for a DatePicker

[TemplatePart("PART_AcceptButton", typeof(Button), IsRequired = true)]
[TemplatePart("PART_DayDownButton", typeof(RepeatButton))]
[TemplatePart("PART_DayHost", typeof(Panel), IsRequired = true)]
[TemplatePart("PART_DaySelector", typeof(DateTimePickerPanel), IsRequired = true)]
[TemplatePart("PART_DayUpButton", typeof(RepeatButton))]
[TemplatePart("PART_DismissButton", typeof(Button))]
[TemplatePart("PART_FirstSpacer", typeof(Rectangle))]
[TemplatePart("PART_MonthDownButton", typeof(RepeatButton))]
[TemplatePart("PART_MonthHost", typeof(Panel), IsRequired = true)]
[TemplatePart("PART_MonthSelector", typeof(DateTimePickerPanel), IsRequired = true)]
[TemplatePart("PART_MonthUpButton", typeof(RepeatButton))]
[TemplatePart("PART_PickerContainer", typeof(Grid), IsRequired = true)]
[TemplatePart("PART_SecondSpacer", typeof(Rectangle))]
[TemplatePart("PART_YearDownButton", typeof(RepeatButton))]
[TemplatePart("PART_YearHost", typeof(Panel), IsRequired = true)]
[TemplatePart("PART_YearSelector", typeof(DateTimePickerPanel), IsRequired = true)]
[TemplatePart("PART_YearUpButton", typeof(RepeatButton))]
public class DatePickerPresenter : PickerPresenterBase, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue
Inheritance
DatePickerPresenter
Implements
Inherited Members
Extension Methods

Constructors

DatePickerPresenter()

public DatePickerPresenter()

Fields

DateProperty

Defines the Date Property

public static readonly StyledProperty<DateTimeOffset> DateProperty

Field Value

StyledProperty<DateTimeOffset>

DayFormatProperty

Defines the DayFormat Property

public static readonly StyledProperty<string> DayFormatProperty

Field Value

StyledProperty<string>

DayVisibleProperty

Defines the DayVisible Property

public static readonly StyledProperty<bool> DayVisibleProperty

Field Value

StyledProperty<bool>

MaxYearProperty

Defines the MaxYear Property

public static readonly StyledProperty<DateTimeOffset> MaxYearProperty

Field Value

StyledProperty<DateTimeOffset>

MinYearProperty

Defines the MinYear Property

public static readonly StyledProperty<DateTimeOffset> MinYearProperty

Field Value

StyledProperty<DateTimeOffset>

MonthFormatProperty

Defines the MonthFormat Property

public static readonly StyledProperty<string> MonthFormatProperty

Field Value

StyledProperty<string>

MonthVisibleProperty

Defines the MonthVisible Property

public static readonly StyledProperty<bool> MonthVisibleProperty

Field Value

StyledProperty<bool>

YearFormatProperty

Defines the YearFormat Property

public static readonly StyledProperty<string> YearFormatProperty

Field Value

StyledProperty<string>

YearVisibleProperty

Defines the YearVisible Property

public static readonly StyledProperty<bool> YearVisibleProperty

Field Value

StyledProperty<bool>

Properties

Date

Gets or sets the current Date for the picker

public DateTimeOffset Date { get; set; }

Property Value

DateTimeOffset

DayFormat

Gets or sets the DayFormat

public string DayFormat { get; set; }

Property Value

string

DayVisible

Get or sets whether the Day selector is visible

public bool DayVisible { get; set; }

Property Value

bool

MaxYear

Gets or sets the maximum pickable year

public DateTimeOffset MaxYear { get; set; }

Property Value

DateTimeOffset

MinYear

Gets or sets the minimum pickable year

public DateTimeOffset MinYear { get; set; }

Property Value

DateTimeOffset

MonthFormat

Gets or sets the month format

public string MonthFormat { get; set; }

Property Value

string

MonthVisible

Gets or sets whether the month selector is visible

public bool MonthVisible { get; set; }

Property Value

bool

YearFormat

Gets or sets the year format

public string YearFormat { get; set; }

Property Value

string

YearVisible

Gets or sets whether the year selector is visible

public bool YearVisible { get; set; }

Property Value

bool

Methods

OnApplyTemplate(TemplateAppliedEventArgs)

Called when the control's template is applied. In simple terms, this means the method is called just before the control is displayed.

protected override void OnApplyTemplate(TemplateAppliedEventArgs e)

Parameters

e TemplateAppliedEventArgs

The event args.

OnKeyDown(KeyEventArgs)

Called before the KeyDown event occurs.

protected override void OnKeyDown(KeyEventArgs e)

Parameters

e KeyEventArgs

The event args.

OnPropertyChanged(AvaloniaPropertyChangedEventArgs)

Called when a avalonia property changes on the object.

protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)

Parameters

change AvaloniaPropertyChangedEventArgs

The property change details.