Using RadSlideView, when swiping on image swipe don't working, where as when outside of the image it works - MAUI Issue.

1 Answer 97 Views
SlideView
Mohammed Rameez
Top achievements
Rank 1
Iron
Mohammed Rameez asked on 25 Jul 2023, 02:16 PM

Hi Telerik,

I am using RadSlideView to display images, but the to swipe from one image to another, the swipe is not working when done on the image.

Whereas when done anywhere outside of the image (i.e. any where inside RadSlideView other than image) it works.

 

The below is the code that I am using.

NOTE: Same code works fine in Xamarin and not in MAUI.

 

Thanks,

Mohammed Rameez Raza.

1 Answer, 1 is accepted

Sort by
0
Lance | Senior Manager Technical Support
Telerik team
answered on 25 Jul 2023, 03:47 PM

Hello Mohammed Rameez,

Thank you for sharing a screenshot of the code, it explains why you're experiencing the behavior... it is entirely expected because the TapGestureRecognizer is stealing the user's gesture first and not giving it to the SlideView.

There is no way in .NET MAUI to combine/chain gesture recognizers, this is somethign Microsoft is going to have to handle inside the framework. Additionally problematic is there's nothing the SlideView can do because your DataTemplate is interfering with the SlideView's operation. So you're going to have to make a decision on how you want to user to interact with the image.

My recommendation would be to add a semi-transparent button on top of the image that lets the user select the image for whatever you're doing inside the PressedCommand. For example:

<DataTemplate>
    <Grid>
        <Image .../>
        
        <Button
            Text="zoom-icon-goes-here" 
            Command={Binding BindingContext.PressedCommand, Source...} 
            HorizontalOptions="End"
            VerticalOptions="End"
            Margin="10"
            BackgroundColor="#99000000"
            TextColor="#99FFFFFF"/>
    </Grid>
</DataTemplate>

I hope this helps!

Side Note: You cannot compare the Xamarin control with the MAUI control. They are fundamentally different controls, we have completely started from scratch to modernize the MAUI one it to meet everyone' demands for it to be more like a data control that has an ItemTemplate of type DataTemplate (rather than a ControlTemplate that replaces views). This can't be a copy/paste from Xamarin to MAUI, there are several considerations to think about while migrating your app to .NET 6/7/8, see this article for more details of things we can assist with => Migrating the SlideView from Xamarin.Forms to .NET MAUI.

Regards,
Lance | Manager Technical Support
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
SlideView
Asked by
Mohammed Rameez
Top achievements
Rank 1
Iron
Answers by
Lance | Senior Manager Technical Support
Telerik team
Share this question
or