Silverlight (5?) DatePicker binding behavior issue

Topics: Bugs, UI Architecture
Jun 26, 2012 at 11:40 AM

Hi,

I recognized the following strange behavior with the DatePicker control (in my opinion everything was fine a few weeks/months ago):

When selecting a date, I try to adjust the value in the setter of the SelectedDate-property, i.e. when the date is a future date, reset it to today, because future dates are not allowed.

private DateTime _datum;
      public DateTime Datum
      {
         get { return _datum; }
         set
         {
            _datum = value > DateTime.Today ? DateTime.Today : value;
            NotifyOfPropertyChange( () => Datum );
         }
      }
<sdk:DatePicker Grid.Column="1" Margin="2" SelectedDate="{Binding Datum, Mode=TwoWay}" Width="120" Height="25"/>

 The property gets updated correctly but the datepicker control isn't, it continues showing the wrong date. I'm 100% sure that this worked before (it's not the only location in my app where the behavior changed), so I am very surprised.

Does anyone encountered the same behavior? Any ideas and solutions appreciated.

The app is a SL4 app, browser IE9 with SL5 plugin (has SL 5 plugin changed the datepicker's behavior?).