Esempio n. 1
0
        private void TrackResizePreview(SplitterGrip grip, double horizontalChange, double verticalChange)
        {
            int gripIndex;
            int resizeIndex1;
            int resizeIndex2;

            if (!this.GetResizeIndices(grip, out gripIndex, out resizeIndex1, out resizeIndex2))
            {
                return;
            }
            double pixelAmount = this.Orientation == Orientation.Horizontal ? horizontalChange : verticalChange;
            IList <SplitterMeasureData> splitterMeasureDataList = SplitterMeasureData.FromElements((IList)this.InternalChildren);

            this.ResizeChildrenCore(splitterMeasureDataList[resizeIndex1], splitterMeasureDataList[resizeIndex2], pixelAmount);
            SplitterPanel.Measure(this.RenderSize, this.Orientation, (IEnumerable <SplitterMeasureData>)splitterMeasureDataList, false);
            Point point = grip.TransformToAncestor((Visual)this).Transform(new Point(0.0, 0.0));

            if (this.Orientation == Orientation.Horizontal)
            {
                point.X += splitterMeasureDataList[gripIndex].MeasuredBounds.Width - this.InternalChildren[gripIndex].RenderSize.Width;
            }
            else
            {
                point.Y += splitterMeasureDataList[gripIndex].MeasuredBounds.Height - this.InternalChildren[gripIndex].RenderSize.Height;
            }
            Point screen = this.PointToScreen(point);

            this.currentPreviewWindow.Move((double)(int)screen.X, (double)(int)screen.Y);
        }
Esempio n. 2
0
 protected override Size MeasureOverride(Size availableSize)
 {
     this.UpdateIndices();
     return(SplitterPanel.Measure(availableSize, this.Orientation, (IEnumerable <SplitterMeasureData>)SplitterMeasureData.FromElements((IList)this.InternalChildren), true));
 }