I have 2 calendars which I want to show this month and next one, but both with same selected date. I use 2 simple properties ShownDate in my model to store and calculate current and next month.
<Calendar SelectedDate="{Binding Date, Mode=TwoWay}"
DisplayDate="{Binding ShownDate, Mode=TwoWay}"
Margin="4" AllowDrop="True" />
<Calendar SelectedDate="{Binding Date, Mode=TwoWay}"
DisplayDate="{Binding ShownDate2, Mode=TwoWay}"
Margin="4" AllowDrop="True" />
I realized that before showing it, I get a propagation to my model in the ShownDate2 property setting current month (UpdateSource), so forgotting my default values (it must be next month, not current). And it happens before any query for my value (UpdateTarget occurs later).
Is this a bug in Calendar.DisplayDate binding behavior?
Note that all this is contained in a DataTemplate being drawn by a ContentPresenter, but I think it doesn't matter.
UPDATE: Now I'm sure DataTemplates do matter, but can't reproduce the bug in a simple project. I'm still lost.