title: Moving the line in WPF
body: <p>I need to implement the function of moving <code>newLine_MouseMove</code>, so that I could with the mouse to move the line around the Canvas, and not only in the lower right corner as shown in the <code>Code</code>:</p>
  
  <p><img src="https://i.stack.imgur.com/TyHV7.png" alt="enter image description here"></p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>private void newLine_MouseMove(object sender, MouseEventArgs e)
  {
      if (Mouse.LeftButton == MouseButtonState.Pressed) //Movement only when the key is pressed
      {
          if (ExitLine())  //The function returns a value true, if the line is within the Canvas.
          {
              if (selectedLine != null) //If you select a line
              {
                  //????????????????????
                  /*
                  selectedLine.X1 += 1;
                  selectedLine.Y1 += 1;
                  selectedLine.X2 += 1;
                  selectedLine.Y2 += 1;
                  */
              }
          }
      }
  }
  </code></pre>
  
  <p>Would love to get a detailed answer.</p>
  
  <p>Thank you.</p>