How to check if the mouse moves, while the left mouse button is down, in c# How to check if the mouse moves, while the left mouse button is down, in c# wpf wpf

How to check if the mouse moves, while the left mouse button is down, in c#


Here's an example (WPF):

public MainWindow(){    InitializeComponent();    this.MouseMove += new MouseEventHandler(MainWindow_MouseMove);}void MainWindow_MouseMove(object sender, MouseEventArgs e){    if (e.LeftButton == MouseButtonState.Pressed)    {        //do something    }}