private string FormatConditionTypeEnumFormatting(FormatConditionType formatConditionType)
        {
            switch (formatConditionType)
            {
            case FormatConditionType.Default:
                return(StringResources.FormatConditionTypeDefault);

            case FormatConditionType.TopItemsRule:
                return(StringResources.FormatConditionTypeTopItemsRule);

            case FormatConditionType.TopPersentRule:
                return(StringResources.FormatConditionTypeTopPersentRule);

            case FormatConditionType.BottomItemsRule:
                return(StringResources.FormatConditionTypeBottomItemsRule);

            case FormatConditionType.BottomPercentRule:
                return(StringResources.FormatConditionTypeBottomPercentRule);

            case FormatConditionType.AboveAverageRule:
                return(StringResources.FormatConditionTypeAboveAverageRule);

            case FormatConditionType.BelowAverageRule:
                return(StringResources.FormatConditionTypeBelowAverageRule);

            case FormatConditionType.DataBar:
                return(StringResources.FormatConditionTypeDataBar);

            case FormatConditionType.ColorScale:
                return(StringResources.FormatConditionTypeColorScale);

            case FormatConditionType.IconSet:
                return(StringResources.FormatConditionTypeIconSet);

            default:
                throw new DeveloperException("Undefined FormatConditionType '{0}'.", formatConditionType);
            }
        }
        private void OnConditionFormatTypeChamged(FormatConditionType formatConditionType)
        {
            ThresholdVisibility  = Visibility.Collapsed;
            LayoutItemVisibility = Visibility.Visible;
            ApplyToRowVisibility = Visibility.Visible;
            //_expressionEditor.IsEnabled = false;
            PredefinedFormatNameVisibility = Visibility.Collapsed;

            switch (formatConditionType)
            {
            case FormatConditionType.Default:
                _expressionEditor.IsEnabled = true;
                break;

            case FormatConditionType.TopItemsRule:
                ThresholdLabel =
                    StringResources.ConditionalFormattingWindowAppearanceGroupThresholdLabel;
                ThresholdVisibility = Visibility.Visible;
                break;

            case FormatConditionType.TopPersentRule:
                ThresholdLabel =
                    StringResources.ConditionalFormattingWindowAppearanceGroupThresholdInPercentLabel;
                ThresholdVisibility = Visibility.Visible;
                break;

            case FormatConditionType.BottomItemsRule:
                ThresholdLabel =
                    StringResources.ConditionalFormattingWindowAppearanceGroupThresholdLabel;
                ThresholdVisibility = Visibility.Visible;
                break;

            case FormatConditionType.BottomPercentRule:
                ThresholdLabel =
                    StringResources.ConditionalFormattingWindowAppearanceGroupThresholdInPercentLabel;
                ThresholdVisibility = Visibility.Visible;
                break;

            case FormatConditionType.AboveAverageRule:
            case FormatConditionType.BelowAverageRule:
                //Не работает
                ApplyToRowVisibility = Visibility.Collapsed;
                break;

            case FormatConditionType.DataBar:
                LayoutItemVisibility           = Visibility.Collapsed;
                ApplyToRowVisibility           = Visibility.Collapsed;
                PredefinedFormatNameVisibility = Visibility.Visible;
                FormatTemplateKey = ConditionalFormattingThemeKeys.DataBarMenuItemContent;
                break;

            case FormatConditionType.ColorScale:
                LayoutItemVisibility           = Visibility.Collapsed;
                ApplyToRowVisibility           = Visibility.Collapsed;
                PredefinedFormatNameVisibility = Visibility.Visible;
                FormatTemplateKey = ConditionalFormattingThemeKeys.ColorScaleMenuItemContent;
                break;

            case FormatConditionType.IconSet:
                LayoutItemVisibility           = Visibility.Collapsed;
                ApplyToRowVisibility           = Visibility.Collapsed;
                PredefinedFormatNameVisibility = Visibility.Visible;
                FormatTemplateKey = ConditionalFormattingThemeKeys.IconSetMenuItemContent;
                break;
            }
        }