GestureRecognizers for net6 and prior versions #10872
-
Hi! I was wondering if GestureRecognizers was supported on uno and if so how can I use it. I am trying to convert a xamarin.forms app to an uno net6 project. In my xamarin.forms app I am using <StackLayout Orientation="Horizontal">
<StackLayout.GestureRecognizers>
<TapGestureRecognizer Command="{Binding ShowAvailableEnvironmentsCommand}"/>
</StackLayout.GestureRecognizers>
<Label Text="{Binding ViewModel.AlternateEnvironment}" Style="{StaticResource listSelectorLabel}" FontSize="16" />
<Label Text="{x:Static utils:MaterialIcons.ChevronDown}"
Style="{StaticResource smallSuffixGlyphLabel}"
FontSize="16"
VerticalTextAlignment="Center"
HorizontalOptions="End" />
</StackLayout> Is there an easy translation for GestureRecognizers? FYI, I know StackLayout and Label are going to become StackPanel and TextBlock. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You should look at the "Manipulation events" https://learn.microsoft.com/en-us/windows/apps/design/input/touch-interactions#manipulation-events Basically you only have to set the |
Beta Was this translation helpful? Give feedback.
You should look at the "Manipulation events" https://learn.microsoft.com/en-us/windows/apps/design/input/touch-interactions#manipulation-events
Basically you only have to set the
ManipulationMode=TranslateX
(orManipulationMode=TranslateX|TranslateInertia
to enable inertia) on the element you want to drag and then listen toManipulationStarted
,ManipulationDelta
andManipulationCompleted
events.