Have to click away twice from Calendar in WPF

后端 未结 7 1715
南旧
南旧 2021-02-01 19:17

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

7条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-01 19:52

    Found this

    Code:

    public void ReleaseMouse()
    {
        if (Mouse.Captured is CalendarItem) Mouse.Capture(null);
    }
    

    XAML:

    
    

    Source: https://quick-geek.github.io/answers/819560/index.html

    Easy and seems to have no drawbacks:

提交回复
热议问题