private void SetBrushColor_Click()

in dev/CommonStyles/TestUI/CalendarViewPage.xaml.cs [442:574]


        private void SetBrushColor_Click(object sender, RoutedEventArgs e)
        {
            SolidColorBrush solidColorBrush = GetSolidColorBrush();

            if (solidColorBrush == null && brushPropertyName.SelectedIndex != 36)
            {
                return;
            }

            switch (brushPropertyName.SelectedIndex)
            {
                case 0: // Background
                    PageCalendar.Background = PageCalendar2.Background = solidColorBrush;
                    break;
                case 2: // BlackoutForeground
                    PageCalendar.BlackoutForeground = PageCalendar2.BlackoutForeground = solidColorBrush;
                    break;
                case 4: // BorderBrush
                    PageCalendar.BorderBrush = PageCalendar2.BorderBrush = solidColorBrush;
                    break;
                case 5: // CalendarItemBorderBrush
                    PageCalendar.CalendarItemBorderBrush = PageCalendar2.CalendarItemBorderBrush = solidColorBrush;
                    break;
                case 6: // CalendarItemBackground
                    PageCalendar.CalendarItemBackground = PageCalendar2.CalendarItemBackground = solidColorBrush;
                    break;
                case 8: // CalendarItemForeground
                    PageCalendar.CalendarItemForeground = PageCalendar2.CalendarItemForeground = solidColorBrush;
                    break;
                case 12: // Foreground
                    PageCalendar.Foreground = PageCalendar2.Foreground = solidColorBrush;
                    break;
                case 13: // HoverBorderBrush
                    PageCalendar.HoverBorderBrush = PageCalendar2.HoverBorderBrush = solidColorBrush;
                    break;
                case 14: // OutOfScopeBackground
                    PageCalendar.OutOfScopeBackground = PageCalendar2.OutOfScopeBackground = solidColorBrush;
                    break;
                case 15: // OutOfScopeForeground
                    PageCalendar.OutOfScopeForeground = PageCalendar2.OutOfScopeForeground = solidColorBrush;
                    break;
                case 18: // PressedBorderBrush
                    PageCalendar.PressedBorderBrush = PageCalendar2.PressedBorderBrush = solidColorBrush;
                    break;
                case 19: // PressedForeground
                    PageCalendar.PressedForeground = PageCalendar2.PressedForeground = solidColorBrush;
                    break;
                case 20: // SelectedBorderBrush
                    PageCalendar.SelectedBorderBrush = PageCalendar2.SelectedBorderBrush = solidColorBrush;
                    break;
                case 23: // SelectedForeground
                    PageCalendar.SelectedForeground = PageCalendar2.SelectedForeground = solidColorBrush;
                    break;
                case 24: // SelectedHoverBorderBrush
                    PageCalendar.SelectedHoverBorderBrush = PageCalendar2.SelectedHoverBorderBrush = solidColorBrush;
                    break;
                case 26: // SelectedPressedBorderBrush
                    PageCalendar.SelectedPressedBorderBrush = PageCalendar2.SelectedPressedBorderBrush = solidColorBrush;
                    break;
                case 32: // TodayForeground
                    PageCalendar.TodayForeground = PageCalendar2.TodayForeground = solidColorBrush;
                    break;
                case 36: // CalendarViewDayItem.Background
                    SetBackgrounds(PageCalendar, solidColorBrush);
                    SetBackgrounds(PageCalendar2, solidColorBrush);
                    break;
                default:
                    if (PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.TwentyOneH1))
                    {
                        switch (brushPropertyName.SelectedIndex)
                        {
                            case 1: // BlackoutBackground
                                PageCalendar.BlackoutBackground = PageCalendar2.BlackoutBackground = solidColorBrush;
                                break;
                            case 3: // BlackoutStrikethroughBrush
                                PageCalendar.BlackoutStrikethroughBrush = PageCalendar2.BlackoutStrikethroughBrush = solidColorBrush;
                                break;
                            case 7: // CalendarItemDisabledBackground
                                PageCalendar.CalendarItemDisabledBackground = PageCalendar2.CalendarItemDisabledBackground = solidColorBrush;
                                break;
                            case 9: // CalendarItemHoverBackground
                                PageCalendar.CalendarItemHoverBackground = PageCalendar2.CalendarItemHoverBackground = solidColorBrush;
                                break;
                            case 10: // CalendarItemPressedBackground
                                PageCalendar.CalendarItemPressedBackground = PageCalendar2.CalendarItemPressedBackground = solidColorBrush;
                                break;
                            case 11: // DisabledForeground
                                PageCalendar.DisabledForeground = PageCalendar2.DisabledForeground = solidColorBrush;
                                break;
                            case 16: // OutOfScopeHoverForeground
                                PageCalendar.OutOfScopeHoverForeground = PageCalendar2.OutOfScopeHoverForeground = solidColorBrush;
                                break;
                            case 17: // OutOfScopePressedForeground
                                PageCalendar.OutOfScopePressedForeground = PageCalendar2.OutOfScopePressedForeground = solidColorBrush;
                                break;
                            case 21: // SelectedDisabledBorderBrush
                                PageCalendar.SelectedDisabledBorderBrush = PageCalendar2.SelectedDisabledBorderBrush = solidColorBrush;
                                break;
                            case 22: // SelectedDisabledForeground
                                PageCalendar.SelectedDisabledForeground = PageCalendar2.SelectedDisabledForeground = solidColorBrush;
                                break;
                            case 25: // SelectedHoverForeground
                                PageCalendar.SelectedHoverForeground = PageCalendar2.SelectedHoverForeground = solidColorBrush;
                                break;
                            case 27: // SelectedPressedForeground
                                PageCalendar.SelectedPressedForeground = PageCalendar2.SelectedPressedForeground = solidColorBrush;
                                break;
                            case 28: // TodayBackground
                                PageCalendar.TodayBackground = PageCalendar2.TodayBackground = solidColorBrush;
                                break;
                            case 29: // TodayBlackoutBackground
                                PageCalendar.TodayBlackoutBackground = PageCalendar2.TodayBlackoutBackground = solidColorBrush;
                                break;
                            case 30: // TodayBlackoutForeground
                                PageCalendar.TodayBlackoutForeground = PageCalendar2.TodayBlackoutForeground = solidColorBrush;
                                break;
                            case 31: // TodayDisabledBackground
                                PageCalendar.TodayDisabledBackground = PageCalendar2.TodayDisabledBackground = solidColorBrush;
                                break;
                            case 33: // TodayHoverBackground
                                PageCalendar.TodayHoverBackground = PageCalendar2.TodayHoverBackground = solidColorBrush;
                                break;
                            case 34: // TodayPressedBackground
                                PageCalendar.TodayPressedBackground = PageCalendar2.TodayPressedBackground = solidColorBrush;
                                break;
                            case 35: // TodaySelectedInnerBorderBrush
                                PageCalendar.TodaySelectedInnerBorderBrush = PageCalendar2.TodaySelectedInnerBorderBrush = solidColorBrush;
                                break;
                        }
                    }
                    break;
            }
        }