Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wpf calendar appears empty when displaymode is year or decade

Tags:

wpf

calendar

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¡¡

like image 876
mcartur Avatar asked Dec 27 '11 11:12

mcartur


1 Answers

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!

like image 58
Luke Avatar answered Oct 12 '22 12:10

Luke