コード例 #1
0
        protected override Size ArrangeContentOverride(Rect arrangeRect)
        {
            double legendWidth = Math.Min(arrangeRect.Width,
                                          Math.Max(Math.Max(legendScrollerYUpper.DesiredSize.Width, legendScrollerYLower.DesiredSize.Width), TotalZoom100Button !.DesiredSize.Width));
            double remainingWidth = arrangeRect.Width - legendWidth;
            double legendHeight   = Math.Min(arrangeRect.Height,
                                             Math.Max(legendScrollerX.DesiredSize.Height, TotalZoom100Button.DesiredSize.Height + TotalZoomOutButton !.DesiredSize.Height));
            double remainingHeight = arrangeRect.Height - legendHeight;
            double plotArea0Height = remainingHeight * plotAreaRatio;
            double plotArea1Height = remainingHeight * (1 - plotAreaRatio);

            legendScrollerYUpper.ArrangeBorderPadding(arrangeRect, remainingWidth, 0, legendWidth, plotArea0Height);
            legendScrollerYLower.ArrangeBorderPadding(arrangeRect, remainingWidth, plotArea0Height, legendWidth, plotArea1Height);
            legendScrollerX.ArrangeBorderPadding(arrangeRect, 0, remainingHeight, remainingWidth, legendHeight);
            //arrange plot-area after scrollers, which might change the values plot-area has to display
            plotAreaUpper.ArrangeBorderPadding(arrangeRect, 0, 0, remainingWidth, plotArea0Height);
            plotAreaLower.ArrangeBorderPadding(arrangeRect, 0, plotArea0Height, remainingWidth, plotArea1Height);
            TotalZoom100Button.ArrangeBorderPadding(arrangeRect, remainingWidth, remainingHeight, legendWidth, TotalZoom100Button.DesiredSize.Height);

            double zoomInOutY = remainingHeight + TotalZoom100Button.DesiredSize.Height;

            TotalZoomOutButton.ArrangeBorderPadding(arrangeRect, remainingWidth, zoomInOutY,
                                                    TotalZoomOutButton.DesiredSize.Width, TotalZoomOutButton.DesiredSize.Height);
            TotalZoomInButton !.ArrangeBorderPadding(arrangeRect, arrangeRect.Width - TotalZoomInButton !.DesiredSize.Width, zoomInOutY, TotalZoomInButton.DesiredSize.Width, TotalZoomInButton.DesiredSize.Height);
            return(arrangeRect.Size);
        }
コード例 #2
0
        protected override Size ArrangeContentOverride(Rect arrangeRect)
        {
            double legendWidth =
                Math.Min(arrangeRect.Width,
                         Math.Max(
                             Math.Max(
                                 Math.Max(
                                     Math.Max(legendScrollerY0.DesiredSize.Width, legendScrollerY1.DesiredSize.Width),
                                     legendScrollerY2.DesiredSize.Width),
                                 legendScrollerY3.DesiredSize.Width),
                             TotalZoom100Button !.DesiredSize.Width));
            double remainingWidth = arrangeRect.Width - legendWidth;
            double legendHeight   = Math.Min(arrangeRect.Height,
                                             Math.Max(legendScrollerX.DesiredSize.Height, TotalZoom100Button.DesiredSize.Height + TotalZoomOutButton !.DesiredSize.Height));
            double remainingHeight = arrangeRect.Height - legendHeight;
            double plotArea0Height = remainingHeight * heightRatio0;
            double plotArea1Height = remainingHeight * heightRatio1;
            double plotArea2Height = remainingHeight * heightRatio2;
            double plotArea3Height = remainingHeight * heightRatio3;
            var    y = 0.0;

            legendScrollerY0.ArrangeBorderPadding(arrangeRect, remainingWidth, y, legendWidth, plotArea0Height);
            y += plotArea0Height;
            legendScrollerY1.ArrangeBorderPadding(arrangeRect, remainingWidth, y, legendWidth, plotArea1Height);
            y += plotArea1Height;
            legendScrollerY2.ArrangeBorderPadding(arrangeRect, remainingWidth, y, legendWidth, plotArea2Height);
            y += plotArea2Height;
            legendScrollerY3.ArrangeBorderPadding(arrangeRect, remainingWidth, y, legendWidth, plotArea3Height);
            legendScrollerX.ArrangeBorderPadding(arrangeRect, 0, remainingHeight, remainingWidth, legendHeight);

            //arrange plot-area after scrollers, which might change the values plot-area has to display
            y = 0.0;
            plotArea0.ArrangeBorderPadding(arrangeRect, 0, y, remainingWidth, plotArea0Height);
            y += plotArea0Height;
            plotArea1.ArrangeBorderPadding(arrangeRect, 0, y, remainingWidth, plotArea1Height);
            y += plotArea1Height;
            plotArea2.ArrangeBorderPadding(arrangeRect, 0, y, remainingWidth, plotArea2Height);
            y += plotArea2Height;
            plotArea3.ArrangeBorderPadding(arrangeRect, 0, y, remainingWidth, plotArea3Height);
            TotalZoom100Button.ArrangeBorderPadding(arrangeRect, remainingWidth, remainingHeight, legendWidth, TotalZoom100Button.DesiredSize.Height);

            double zoomInOutY = remainingHeight + TotalZoom100Button.DesiredSize.Height;

            TotalZoomOutButton.ArrangeBorderPadding(arrangeRect, remainingWidth, zoomInOutY,
                                                    TotalZoomOutButton.DesiredSize.Width, TotalZoomOutButton.DesiredSize.Height);
            TotalZoomInButton !.ArrangeBorderPadding(arrangeRect, arrangeRect.Width - TotalZoomInButton !.DesiredSize.Width, zoomInOutY, TotalZoomInButton.DesiredSize.Width, TotalZoomInButton.DesiredSize.Height);
            return(arrangeRect.Size);
        }