how to draw polygon in uwp RRS feed

  • Question

  •  Hi

    How to draw a polygon in code not xaml 

    I Have example in c# but it doesn't work in

    var polygon1 = new Polygon();
    polygon1.Fill = new SolidColorBrush(Windows.UI.Colors.LightBlue);
    var points = new PointCollection();
    points.Add(new Windows.Foundation.Point(10, 200));
    points.Add(new Windows.Foundation.Point(60, 140));
    points.Add(new Windows.Foundation.Point(130, 140));
    points.Add(new Windows.Foundation.Point(180, 200));
    polygon1.Points = points;

    If i write 

     Dim poly As New polygon 

    polygon doesn't appear in intellisense 


    Thursday, January 9, 2020 6:45 PM


  • Try adding ‘Imports Windows.UI.Xaml.Shapes’ to the beginning. The other statements can be converted easily.

    • Marked as answer by Shay_w Thursday, January 9, 2020 8:26 PM
    Thursday, January 9, 2020 6:52 PM