title: How to set the WPF StrokeDashArray from Code behind?
body: <p>Can i know how to set the StrokeDashArray from code behind? I try to use the method like the way how to set the margin...but it doesn't work.</p>
  
  <p>The following is my code: </p>
  
  <pre><code>public static void DrawCircle(MainWindow main)
      {
          Ellipse myCircle = new Ellipse();
          myCircle.Stroke = Brushes.Orange;
          myCircle.Width = 25;
          myCircle.Height = 25;
          myCircle.StrokeThickness = 2;
          myCircle.StrokeDashArray = new System.Windows.Thickness("2,2,2,2");
  
          Canvas.SetLeft(myCircle, 10);
          Canvas.SetRight(myCircle, 10);
          Canvas.SetBottom(myCircle, 20);
          Canvas.SetTop(myCircle, 20);
          main.MyCanvas.Children.Add(myCircle);
  
      }
  </code></pre>