title: Render large and clickable grid wpf
body: <p>I'm trying to create a large grid which cells have drawn a clickable (click event) ellipsis.</p>
  
  <p>I'm using a Canvas as a parent and adding Ellipses to it Children List but when I try to render 100x100 ellipsis, it lags.</p>
  
  <p>I've tried rendering them with the DrawingVisual and DrawingContext but then, they are not clickable and I won't be able to store ellipsis properties (color, stroke...).</p>
  
  <p>Current code to render the Ellipsis</p>
  
  <pre><code>for (int i = 0; i &lt; this.grid.Cols; i++) {
      for (int j = 0; j &lt; this.grid.Rows; j++) {
          SolidColorBrush fillBrush = Brushes.Red;
          SolidColorBrush strokeBrush = Brushes.Blue;
  
          Ellipse ellipse = new Ellipse() {
              Width = this.grid.Radius,
              Height = this.grid.Radius,
              Fill = fillBrush,
              Stroke = strokeBrush,
              StrokeThickness = 2
          };
  
          Canvas.SetTop(ellipse, (this.grid.Radius * j) + (j * this.grid.Margin));
          Canvas.SetLeft(ellipse, (this.grid.Radius * i) + (i * this.grid.Margin));
  
          children.Add(ellipse);
          parent.Children.Add(ellipse);
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/t9mrq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/t9mrq.png" alt="enter image description here"></a></p>
  
  <p>Any ideas?</p>