Last Updated: 19 Jan 2023 14:50 by ADMIN
Martin Ivanov
Created on: 20 Dec 2022 11:10
Category: TouchManager
Type: Bug Report
TouchManager: Removing the touch event handlers from an UI element doesn't enable the default press and hold rectangular visual back

Subscribing to touch manager events is setting the Stylus.IsPressAndHoldEnabled attached property on the associated element to False. However, the property is not set back to True, after you remove the TouchManager event handlers from the element. Therefore, the default tap and hold action that displays the rectangular shape over the element is no longer executed.

To work this around set the Stylus.IsPressAndHoldEnabled attached property manually.

DragDropManager.RemoveDragInitializeHandler(element, OnDragInitialized);
Stylus.SetIsPressAndHoldEnabled(element, true);