Wpf calendar displays blank when displaymode is year or decade

I have a standard calendar control defined in my xaml file:

<Calendar Height="200" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,0,0,0" Name="NewCalendarYear" Width="200" SelectedDatesChanged="NewCalendarYear_SelectedDatesChanged" DisplayMode="Decade" /> 

The problem I am facing is that it works correctly when DisplayMode = "Month", but when changing it to "Year" or "Decade" the Calendar appears empty ... with one arrow pointing to the left (I donโ€™t allowed to upload images). I searched, but I did not find a sample of any xaml calendar code that works correctly in these display modes.

Thanksยกยก

+4
source share
1 answer

I had the same problem.

There is some kind of error with setting DisplayMode in XAML. If you set it to codebehind, in the _Load event, it will work!

+4
source

Source: https://habr.com/ru/post/1388117/


All Articles