예제 #1
0
파일: Panel.cs 프로젝트: orb1t/LayItOut
        protected override Size OnMeasure(Size size, IRendererContext context)
        {
            var panelSize = Margin.GetAbsoluteSize() + Padding.GetAbsoluteSize() + Border.AsSpacer().GetAbsoluteSize();

            Inner?.Measure((size - panelSize).Union(Size.Empty), context);

            return((Inner?.DesiredSize ?? Size.Empty) + panelSize);
        }
예제 #2
0
파일: Panel.cs 프로젝트: orb1t/LayItOut
        protected override void OnArrange()
        {
            var(widthExpandable, heightExpandable) = WithExpandable(Margin, Border.AsSpacer(), Padding);
            var widths  = widthExpandable.AsEnumerable().GetEnumerator();
            var heights = heightExpandable.AsEnumerable().GetEnumerator();

            BorderLayout  = Layout.ShrinkBy(GetRealSize(Margin, widths, heights));
            PaddingLayout = BorderLayout.ShrinkBy(GetRealSize(Border.AsSpacer(), widths, heights));
            ActualBorder  = CalculateActualBorder(PaddingLayout, BorderLayout);
            Inner?.Arrange(PaddingLayout.ShrinkBy(GetRealSize(Padding, widths, heights)));
            ActualRadius = CalculateActualRadius();
        }