Exemple #1
0
        /// <summary>
        /// 두 쌍의 <see cref="BindThumb"/>를 시각적으로 이어주는 <see cref="LineConnector"/>를 생성합니다.
        /// </summary>
        /// <param name="output"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        public LineConnector CreateConnectedLine(BindThumb output, BindThumb input)
        {
            if (lineCollection.HasThumbExpression(output, input))
            {
                return(null);
            }

            var connector = new LineConnector(this, output, input);

            if (ZoomPanel != null)
            {
                connector.Line.LineBrush = Brushes.DimGray;

                BindingHelper.SetBinding(
                    ZoomPanel, ZoomPanel.ScaleProperty,
                    connector.Line, BezierLine.StrokeThicknessProperty,
                    converter: new ReciprocalConverter()
                {
                    Factor = 2
                });
            }

            LineLayer.Add(connector.Line);
            lineCollection.Add(connector);

            return(connector);
        }
Exemple #2
0
        /// <summary>
        /// 연결점을 시각적으로 동기화시켜주는 <see cref="LineConnectorBase"/>를 생성합니다.
        /// </summary>
        /// <param name="startPosition"></param>
        /// <param name="endPosition"></param>
        /// <returns></returns>
        public LineConnectorBase CreateConnectedLine(
            Func <LineConnectorBase, Point> startPosition,
            Func <LineConnectorBase, Point> endPosition)
        {
            var connector = new LineConnectorBase(this, startPosition, endPosition);

            if (ZoomPanel != null)
            {
                connector.Line.LineBrush = Brushes.DimGray;

                BindingHelper.SetBinding(
                    ZoomPanel, ZoomPanel.ScaleProperty,
                    connector.Line, BezierLine.StrokeThicknessProperty,
                    converter: new ReciprocalConverter()
                {
                    Factor = 2
                });
            }

            LineLayer.Add(connector.Line);
            lineCollection.Add(connector);

            return(connector);
        }