Exemplo n.º 1
0
        private static void Arrange()
        {
            _IsArrangeRequested = false;
            var queue = GetSeniorViews();

            if (typeof(LayoutManager).Log().IsEnabled(LogLevel.Debug))
            {
                typeof(LayoutManager).Log().LogDebug($"Starting arrange pass, {_arrangeQueue.Count} views in queue, {queue.Count} senior views will be arranged.");
            }
            _arrangeQueue.Clear();

            foreach (var view in queue)
            {
                view.Invalidate();
                if (typeof(LayoutManager).Log().IsEnabled(LogLevel.Debug))
                {
                    typeof(LayoutManager).Log().LogDebug($"Measuring {view} with {GetAncestorCount(view)} ancestors in visual tree.");
                }
                IFrameworkElementHelper.Measure(view, view.ActualSize.Add(view.Margin));
            }
            foreach (var view in queue)
            {
                {
                    typeof(LayoutManager).Log().LogDebug($"Laying out {view} with {GetAncestorCount(view)} ancestors in visual tree.");
                }
                view.Layout(
                    view.Left,
                    view.Top,
                    view.Right,
                    view.Bottom
                    );
            }
        }
        internal static RadSize MeasureVisual(TextBlock visual)
        {
            visual.ClearValue(TextBlock.WidthProperty);
            visual.ClearValue(TextBlock.HeightProperty);
            var result = IFrameworkElementHelper.Measure(visual, RadCalendar.InfinitySize);

            return(new RadSize(result.Width, result.Height));
        }