Skip to content
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 the VisualElement is tapped
  • LongPressCommand: Executed when the VisualElement is long pressed

Both commands can be set on one VisualElement

Usage

The following example makes the Border tappable, the TestCommand will be fired upon tapping.

<Border dui:Touch.Command="{Binding TestCommand}" />

Properties

Inspect the Touch Properties Class to further customize and use it.

Clone this wiki locally