Custom and Change-able Arrowheads

I found this post which shows that it is possible to use custom arrowheads, and I have been able to get it working, but would like to be able to change the arrowhead at runtime via the context menu.

I have tried binding the polygon’s points like this:


<Polygon Stroke="Black" Fill="Green"
                         Points="{Binding Path=Data.ToArrow.Points, Mode=OneWay}"
                         go:LinkPanel.Alignment="MiddleRight"
                         go:LinkPanel.Index="-1"
                         go:LinkPanel.Orientation="Along" />

But that doesn’t seem to work as nothing is showing up. The ToArrow that is bound to is a class that I have created, which looks like this:


public class LinkArrowHead
    {
        private Dictionary<string, List<Point>> ArrowheadShapes;

        private string name;
        public string Name 
        {
            get
            {
                return this.name;
            }
            set
            {
                this.name = value;
                this.points = ArrowheadShapes[this.name];
            } 
        }
        private List<Point> points;
        public List<Point> Points
        {
            get
            {
                return this.points;
            }
        }

        public LinkArrowHead()
        {
            InitializeDictionary();
            this.Name = "Triangle";
        }

        private void InitializeDictionary()
        {
            this.ArrowheadShapes = new Dictionary<string, List<Point>>();

            List<Point> trianglePoints = new List<Point>();
            trianglePoints.Add(new Point(0.250, 0.250));
            trianglePoints.Add(new Point(10.689, 0.250));
            trianglePoints.Add(new Point(10.689, 24.910));
            trianglePoints.Add(new Point(0.250, 24.910));
            this.ArrowheadShapes.Add("Triangle", trianglePoints);

            List<Point> shape1Points= new List<Point>();
            this.ArrowheadShapes.Add("Shape1", shape1Points);

            List<Point> shape2Points = new List<Point>();
            this.ArrowheadShapes.Add("Shape2", shape2Points );
        }
    }

Any suggestions?

Thanks
Ryan

I suspect there’s a type mismatch: Polygon.Points should be a PointCollection, not a List.