예제 #1
0
        /// <summary>
        ///     A special pass for all the stars,
        ///     where remaining space is allocated appropriately
        /// </summary>
        private Size StarMeasure(Size constraint,
                                 Size originalDesiredSize,
                                 RibbonTab ribbonTab,
                                 ref double remainingSpace)
        {
            Size        desiredSize       = originalDesiredSize;
            RibbonGroup nextRibbonGroup   = ribbonTab.GetNextIncreaseSizeGroup();
            double      newRemainingSpace = AllocateStarValues(nextRibbonGroup, remainingSpace);

            if (!DoubleUtil.AreClose(remainingSpace, newRemainingSpace))
            {
                IsStarLayoutPass = true;
                InitializeLayoutOnStars();
                desiredSize      = base.MeasureOverride(constraint);
                IsStarLayoutPass = false;
                remainingSpace   = newRemainingSpace;
            }
            return(desiredSize);
        }
        /// <summary>
        ///     A special pass for all the stars,
        ///     where remaining space is allocated appropriately
        /// </summary>
        private Size StarMeasure(Size constraint,
            Size originalDesiredSize,
            RibbonTab ribbonTab,
            ref double remainingSpace)
        {
            Size desiredSize = originalDesiredSize;
            RibbonGroup nextRibbonGroup = ribbonTab.GetNextIncreaseSizeGroup();
            double newRemainingSpace = AllocateStarValues(nextRibbonGroup, remainingSpace);

            if (!DoubleUtil.AreClose(remainingSpace, newRemainingSpace))
            {
                IsStarLayoutPass = true;
                InitializeLayoutOnStars();
                desiredSize = base.MeasureOverride(constraint);
                IsStarLayoutPass = false;
                remainingSpace = newRemainingSpace;
            }
            return desiredSize;
        }