title: Detect mousedown event on canvas elements
body: <p>Well, because I have nothing better else to do than getting familiar with C# and WPF I decided to make some simple app with graph with visualisation. So I want to put "nodes" on canvas, and move it, connect by edges e.t.c. 
  But I don't know how to detect if some "node" is clicked. 
  I noticed that there's <code>.MouseDown</code> in <code>Ellipse</code> object but don't know how to use it (just <code>if (ellipse.MouseDown)</code> is mot correct) in this situation</p>
  
  <p>xaml:</p>
  
  <pre><code>&lt;Window x:Class="GraphWpf.View"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          Title="View" Height="400" Width="700" ResizeMode="NoResize"&gt;
      &lt;Grid&gt;
          &lt;Canvas x:Name="canvas" MouseDown="Canvas_MouseDown" Background="#227FF2C5" Margin="0,0,107,0" /&gt;
          &lt;CheckBox Content="Put nodes" Height="32" HorizontalAlignment="Left" Margin="591,67,0,0" Name="putNodes" VerticalAlignment="Top" Width="75" /&gt;
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>cs code:</p>
  
  <pre><code>public partial class View : Window
      {
  
  
          public View()
          {
              InitializeComponent();
          }
  
          private Point startPoint;
          private Ellipse test;
  
          List&lt;Ellipse&gt; nodesOnCanv = new List&lt;Ellipse&gt;();
  
          private void Canvas_MouseDown(object sender, MouseButtonEventArgs e)
          {
              startPoint = e.GetPosition(canvas);
  
              if ((bool)putNodes.IsChecked)
              {
  
                  test = new Ellipse();
                  test.Fill = new SolidColorBrush(Colors.Blue);
                  test.Width = 20;
                  test.Height = 20;
  
                  var x = startPoint.X;
                  var y = startPoint.Y;
  
                  Canvas.SetLeft(test, x);
                  Canvas.SetTop(test, y);
  
                  canvas.Children.Add(test);
                  nodesOnCanv.Add(test);
  
              }
              else { 
                  foreach(Ellipse element in nodesOnCanv){ //such statment is incorrect
                      if (element.MouseDown()) { 
                        //do something
                      }
                  }
              }
          }
      } 
  </code></pre>