<Window x:Class="line.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="500" Width="900">
<Canvas x:Name="Canvastest" Background="AntiqueWhite" Height="500" Width="900" MouseLeftButtonDown="MouseLeftButtonDown" MouseLeftButtonUp="MouseLeftButtonUp" MouseMove="MouseMove">
</Canvas>
</Window>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace line
{
public partial class MainWindow : Window
{
private bool isMouseDown = false;
Point startPoint = new Point();
public MainWindow()
{
InitializeComponent();
}