-
Notifications
You must be signed in to change notification settings - Fork 3
Touch
Vetle444 edited this page Aug 14, 2023
·
1 revision
We offer an API to make any VisualElement
tappable, which includes an animation when it is tapped. The animation behaves differently on iOS and Android:
- iOS: A fade out animation is imminent when the element is tapped or held in, and it fades back in when the element is no longer tapped.
- Android: A ripple effect is displayed on the
VisualElement
when its tapped or held.
There are two Commands:
-
Command
: Executed when theVisualElement
is tapped -
LongPressCommand
: Executed when theVisualElement
is long pressed
Both commands can be set on one
VisualElement
The following example makes the Border
tappable, the TestCommand
will be fired upon tapping.
<Border dui:Touch.Command="{Binding TestCommand}" />
Inspect the Touch Properties Class to further customize and use it.