1
Vote

Reassigning StartingDayOfWeek to Sunday doesn't work.

description

I have next xaml:
   <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <StackPanel HorizontalAlignment="Stretch">
                <wpControls:Calendar StartingDayOfWeek="Sunday" Name="MainCalendar"></wpControls:Calendar>
                <RadioButton Name="rbMonday" Checked="RadioButton_Checked">Monday</RadioButton>
                <RadioButton Name="rbSunday"  IsChecked="True" Checked="RadioButton_Checked">Sunday</RadioButton>               
            </StackPanel>
        </Grid>
and code-behind:
private void RadioButton_Checked(object sender, RoutedEventArgs e)
        {
            var rb = sender as RadioButton;
            if (MainCalendar == null)
            {
                return;
            }
            if (rb.Name == "rbMonday")
            {
                MainCalendar.StartingDayOfWeek = DayOfWeek.Monday;
            }
            else
            {
                MainCalendar.StartingDayOfWeek = DayOfWeek.Sunday;
            }
}
When I switch between this "Sunday" and "Monday" options calendar behaves in very strange manner. This happens only when switching to "Sunday". All other days works great.

comments