Edit 2: Thank you all for your feedback. I solved the problem by adding this to my SelectedDatesChanged event:
Mouse.Capture(null);
When I select a
If you select the same date then SelectedDatesChanged won't be raised and you will see the same issue where you need to click twice.
Ideally you should hook to GotMouseCapture event and release the mouse capture from original sender to avoid any mouse captures by calendar control.
private void calendar_GotMouseCapture(object sender, MouseEventArgs e)
{
UIElement originalElement = e.OriginalSource as UIElement;
if (originalElement != null)
{
originalElement.ReleaseMouseCapture();
}
}
Note - You can extract out this in behavior as well by using attached property like mentioned in another answer.