本文介绍了线/线几何的顾问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个装饰类,将一个装饰类放在LineGeometry上.我只希望单击该行时在行的起点和终点出现两个拇指.有人可以帮我吗?

Hi, I''m trying to create an adorner class that puts an adorner on a LineGeometry. I just want two thumbs to appear at the start and endpoints of the line when it''s clicked on. Can anyone help me with this?

推荐答案

public class LineAdorner : Adorner
    {
        public LineAdorner(UIElement adornedElement)
            : base(adornedElement)
        {
        }
        protected override void OnRender(DrawingContext drawingContext)
        {
            if (this.AdornedElement.GetType() == typeof(ConnectorView))
            {
                ConnectorView target = this.AdornedElement as ConnectorView;
                drawingContext.DrawEllipse(Brushes.Black, null, target.StartPoint, 4, 4);
                drawingContext.DrawEllipse(Brushes.Black, null, target.EndPoint, 4, 4);
            }
        }
    }


这篇关于线/线几何的顾问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 02:20