Can't edit Point[] or List at design time

前端 未结 2 1292
有刺的猬
有刺的猬 2021-01-20 00:40

I\'m creating custom control that will draw shape from list (or array) of points. I have basic drawing functionality done, but now I\'m struggling with design-time support i

2条回答
  •  失恋的感觉
    2021-01-20 01:19

    If you can add a reference to PresentationCore and WindowsBase, you can utilize the System.Windows.Media.PointCollection

    private System.Windows.Media.PointCollection _points = new System.Windows.Media.PointCollection();
    public System.Windows.Media.PointCollection Points
    {
        get { return _points; }
        set { _points = value; }
    }
    

    Hope that can help.

提交回复
热议问题