Microsoft.Windows.Controls.Ribbon.RibbonGalleryCategory.CoerceMaxColumnCount C# (CSharp) Method

CoerceMaxColumnCount() private static method

private static CoerceMaxColumnCount ( DependencyObject d, object baseValue ) : object
d System.Windows.DependencyObject
baseValue object
return object
        private static object CoerceMaxColumnCount(DependencyObject d, object baseValue)
        {
            RibbonGalleryCategory me = (RibbonGalleryCategory)d;
            int maxColumnCount = (int)PropertyHelper.GetCoercedTransferPropertyValue(
                me,
                baseValue,
                MaxColumnCountProperty,
                me.RibbonGallery,
                RibbonGallery.MaxColumnCountProperty);

            if (maxColumnCount < (int)me.MinColumnCount)
                return (int)me.MinColumnCount;

            return maxColumnCount;
        }