static void LostMouseCapture(object sender, MouseEventArgs e) { if (device != null && device.IsActive) { device.Position = e.GetPosition(null); device.ReportUp(); device.Deactivate(); device = null; } }
private static void MouseDown(object sender, MouseButtonEventArgs e) { if (device != null && device.IsActive) { device.ReportUp(); device.Deactivate(); device = null; } device = new MouseTouchDevice(e.MouseDevice.GetHashCode()); device.SetActiveSource(e.MouseDevice.ActiveSource); device.Position = e.GetPosition(null); device.Activate(); device.ReportDown(); }