I have the following definition for DatePicker:
<sdk:DatePicker x:Name="dtpStartDate"
Grid.Row="4"
Grid.Column="1"
SelectedDateFormat="Short"
SelectedDate="{Binding MyObject.StartDate, Mode=TwoWay, NotifyOnValidationError=True}"/>
MyObjectis a class containing StartDatethat is defined as a null value DateTime.
class MyObjectClass
{
....
public DateTime? StartDate { get; set; }
....
}
I am using MVVM (via Prism) and MyObjectproperly connected.
The first time I show this view, the date is empty (as expected), and when I click on the collector, the calendar is displayed with the date highlighted today.
If I select a date (other than today's) or show a record with a filled date, then when I close the form to create a new object:
this.MyObject = new MyObjectClass();
the date highlighted when I click on the collector is the date selected earlier.
, "1 2009 ", . StartDate DateTime.Today, , , , .
, null reset ?