Search code examples
c#capturepixelsenseuielement

C# UIElement LostTouchCapture OnLostTouchCapture


I am building an application for the Samsung SUR40 in MS Surface 2.0.

I cant let the LostTouchCapture work anymore.

This is my XAML code:

<Rectangle 
   x:Name="ActiveArea" 
   Fill="Transparent" 
   TouchDown="OnTouchDown" 
   TouchMove="OnTouchMove" 
   LostTouchCapture="OnLostTouchCapture" 
/>

A piece of my C# code:

private void OnLostTouchCapture(object sender, TouchEventArgs args)
{
   Console.WriteLine("Hello World");
}

The TouchDown and TouchMove do work. But I have a problem with the LostTouchCapture. The function was working but now its broke and I dont know why.


Solution

  • I didn't fix it really, but I use the TouchLeave="OnTouchLeave" instead.