DatePicker.MinYear property

Applies to Windows and Windows Phone

Gets or sets the minimum Gregorian year available for picking.

Syntax


public:
property DateTime MinYear { 
   DateTime get();
   void set (DateTime value);
}

Property value

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

The minimum Gregorian year available for picking.

Remarks

The MinYear 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 MinYear 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
MaxYear
Quickstart: Adding a DatePicker

 

 

Show:
© 2014 Microsoft