Click here to Skip to main content
15,886,069 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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?
Posted
Comments
Sandeep Mewara 9-Aug-10 11:19am    
What have you tried so far? Update the question with that. Specific help can be provided by members then.
ely_bob 9-Aug-10 19:33pm    
Language, How are you drawing the line.. etc...?

1 solution

K, so I kind of gave up on trying to draw thumbs on the ends of my line but instead I used ellipses (they weren't supposed to do anything anyway, just provide visual cues)

Here's the code I came up with for anyone who cares (adornes a connectorView which is essentially a linegeometry):

MSIL
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);
            }
        }
    }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900