title: WPF - Drawing on canvas with mouse events
body: <p>I have a problem with handling mouse events on canvas. I want to draw on it using mouse and I've come up with these event handlers, but they don't do anything when I start drawing.</p>
  
  <pre><code>    private void paintSurface_MouseDown(object sender, MouseButtonEventArgs e)
      {
          if (e.ButtonState == MouseButtonState.Pressed)
              currentPoint = e.GetPosition(this);
      }
  
      private void paintSurface_MouseMove(object sender, MouseEventArgs e)
      {
          if (e.LeftButton == MouseButtonState.Pressed)
          {
              Line line = new Line();
  
              line.Stroke = SystemColors.WindowFrameBrush;
              line.X1 = currentPoint.X;
              line.Y1 = currentPoint.Y;
              line.X2 = e.GetPosition(this).X;
              line.Y2 = e.GetPosition(this).Y;
  
              currentPoint = e.GetPosition(this);
  
              paintSurface.Children.Add(line);
          }
      }
  </code></pre>
  
  <p>Can you help me by telling what's missing or how to rewrite it so it'll start working?</p>