ContentElement.CaptureTouch(TouchDevice) ContentElement.CaptureTouch(TouchDevice) ContentElement.CaptureTouch(TouchDevice) Method

定義

嘗試強制將觸控擷取至這個項目。Attempts to force capture of a touch to this element.

public:
 bool CaptureTouch(System::Windows::Input::TouchDevice ^ touchDevice);
public bool CaptureTouch (System.Windows.Input.TouchDevice touchDevice);
member this.CaptureTouch : System.Windows.Input.TouchDevice -> bool

參數

touchDevice
TouchDevice TouchDevice TouchDevice

要擷取的裝置。The device to capture.

傳回

如果指定的觸控已擷取至這個項目,則為 true,否則為 falsetrue if the specified touch is captured to this element; otherwise, false.

例外狀況

touchDevicenulltouchDevice is null.

備註

CaptureTouchfalse 如果目前已捕捉至另一個元素TouchDevice , 將會傳回。CaptureTouch will return false if the TouchDevice is currently captured to another element.

如果CaptureTouch傳回 ,GotTouchCapture則會引發事件。 trueIf CaptureTouch returns true, then the GotTouchCapture event is raised.

若要從這個元素釋放單一觸控的 capture, 請使用ReleaseTouchCapture方法, 並指定要釋放的觸控裝置。To release capture of a single touch from this element, use the ReleaseTouchCapture method and specify the touch device to release. 若要釋放這個專案的所有潤色, 請ReleaseAllTouchCaptures使用方法。To release all touches from this element, use the ReleaseAllTouchCaptures method.

適用於

另請參閱