DatePicker.MaxYear DatePicker.MaxYear DatePicker.MaxYear DatePicker.MaxYear Property


Gets or sets the maximum Gregorian year available for picking.

public : DateTime MaxYear { get; set; }
DateTime MaxYear();

void MaxYear(DateTime maxyear);
public DateTimeOffset MaxYear { get; set; }
Public ReadWrite Property MaxYear As DateTimeOffset

Property Value

DateTimeOffset DateTimeOffset

The maximum Gregorian year available for picking.


The MaxYear property can't be set as a XAML attribute string, because the Windows Runtime XAML parser doesn't have a conversion logic for converting strings to dates as DateTime / DateTimeOffset objects. Here are some suggested ways these objects can be defined in code and set to a date other than the current date.

Another possible technique is to define a date that's available as a data object or in the data context, then set MaxYear as a XAML attribute that references a {Binding} markup extension that can access the date as data.

See also