Search code examples
wpfcalendar

wpf calendar appears empty 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 having is that it works properly when DisplayMode="Month", but when changing it to "Year" or "Decade" the Calendar appears empty... with one arrow pointing to the left (i am not allowed to upload images). I have been searching but I have not found a sample of any xaml calendar code that works properly in these displaymodes.

Thanks¡¡


Solution

  • I was having the same issue.

    There's some kind of bug with setting the DisplayMode in XAML. If you set it in the codebehind, on the _Load event, it will work!