I am developing WinPhone apps.
<DatePicker x:Name="MyDatePicker" MinYear="2016" MaxYear="2017"/>
The code is not working.
I am able to choose previous years and I am able to choose 2015, 2018, etc. If possible, I would like to disable the months and days in DatePicker itself.
In short, I would like to set minimum and maximum allowed date for calendar so that unwanted dates are disabled in the calendar.
According to documentation, XAML parser doesn't have a conversion logic for converting strings to dates as
DateTimeOffset
objects, soMinYear
andMaxYear
property couldn't be set as a XAML attribute string. There are to options to set these properties:DatePicker
control.View model class:
XAML layout: