Sets touch capture to a UIElement.
Assembly: System.Windows (in System.Windows.dll)
When an object is capturing touch input, that object receives touch input whether or not the user’s finger is within its bounding area. Touch input is typically only captured during simulated drag operations. To release touch capture, call the ReleaseMouseCapture method on the object that holds capture.
Touch input can be captured when all of the following conditions are true:
No other object is capturing touch input.
The user’s finger is physically touching the screen.
If one of these conditions is false, the return value is false.
If an initial call returned true and is successfully capturing touch input, subsequent calls to on the same object will still return true unless conditions have changed; returns nothing different if that object already had capture. Depending on your application's requirements, you might find it useful to set a variable that either tracks whether any object holds capture, or provides a reference to the specific object that currently has capture. If you use this technique, set the variable on each call and clear it on each ReleaseMouseCapture call.
Only a UIElement derived object can capture touch input. Notable cases of other objects that have a visual character but cannot capture touch input are Run (only the parent TextBlock can capture) and geometries (only the parent Path can capture).