DatePicker.MaxYear property

Applies to Windows and Windows Phone

Gets or sets the maximum Gregorian year available for picking.

Syntax


Public Property MaxYear As DateTimeOffset

Property value

Type: System.DateTimeOffset [.NET] | Windows::Foundation::DateTime [C++]

The maximum Gregorian year available for picking.

Remarks

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 expression that can access the date as data.

Requirements

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

See also

DatePicker
MinYear
Quickstart: Adding a DatePicker

 

 

Show:
© 2014 Microsoft