Open MAUIoxo opened 10 months ago
Can you test with the latest nightly build? https://github.com/dotnet/maui/wiki/Nightly-Builds
Sorry for the belated response!
Tested with "8.0.6-nightly.9863" and it was working both on Android and on iOS
Great to see that progress :)
I am sorry to say that, but I was progressing with my project and found a scenario in 8.0.10-nightly.10061 in which it is not working unfortunately, also with a newer version :(
Therefore, I added and example project https://github.com/MAUIoxo/TapGestureRecognizerNotWorking_19630 which demonstrates that it is not working when I have to following XAML code:
<SwipeItemView>
<Grid RowDefinitions="*" ColumnDefinitions="*" WidthRequest="80" HeightRequest="100" ColumnSpacing="0">
<Label Grid.Column="0" Text="Exclude" BackgroundColor="{StaticResource Tertiary}" TextColor="White" Style="{StaticResource SwipeItemStyle}">
<Label.GestureRecognizers>
<TapGestureRecognizer Command="{Binding Source={RelativeSource AncestorType={x:Type viewModels:TabView1ViewModel}}, Path=ExcludeFromStoreSelectionCommand}"
CommandParameter="{Binding .}"/>
</Label.GestureRecognizers>
</Label>
</Grid>
</SwipeItemView>
When using the non customized SwipeItem
I reach my breakpoint in the TabView1ViewModel.cs
in method ExcludeFromStoreSelectionCommandHandler:
<SwipeItem Text="EXCLUDE"
BackgroundColor="{StaticResource DarkOrange1}"
Command="{Binding Source={RelativeSource AncestorType={x:Type viewModels:TabView1ViewModel}}, Path=ExcludeFromStoreSelectionCommand}"
CommandParameter="{Binding .}">
</SwipeItem>
In case I am allowed to guess, I would say this has something to do with nesting depth or where it is located underneath. I use the exact same SwipeItemView
in a different place in my App in which I first detected that it worked again (see History of comments above). In this case of the attached App it doesn’t work
Any workarounds to that? See no other ways to customize that and get the command fire :(
@PureWeen - Do you think there is a way to look at this soon? This is really bothering development when there is no workaround as it seems right now
Verified this issue with Visual Studio 17.10.0 Preview 1. Can repro on Android/iOS platform with sample project.
@PureWeen - Do you think there is a way to look at this soon? This is really bothering development when there is no workaround as it seems right now
Have you found a workaround? Can Repro in my own Project with Visual Studio 17.9.6 - Only on iOS.
I found something, but that is not possible in general. In my case, I wanted to just customize the font settings and have only one element in the SwipeItem, a simple „Delete“ Button. So, I really used a Button
and implemented its Clicked
-Event. In the handler I used a message and WeakReference
-Manager to send a Message to the ViewModel
in which I could delete the item then. Not the best way, but I could achieve it doing this and have this as a workaround for this bug.
Last week, I found a funny workaround for a different issue in which I simply had to derive from a Switch
and use this CustomSwitch
in my XAML
. Haven’t tested that here, but as this was a funny fix, why not try it here and maybe it also works. This fix did not make sense at all, but you never know and it works here, too. Let us know if you find out anything
Description
I use a
SwipeItemView
with aGrid/HorizontalStackLayout/...
within aCollectionView DataTemplate
. The App was used under .NET 7 and working fine. When I migrated it to .NET 8 theLabel.GestureRecognizers
for my Edit/Delete-Button do not work anymore and theEditFoodItemCommand/DeleteFoodItemCommand
-Handlers in the Code below do not work anymore. You can click on the Labels, but nothing happens and the Code for one of the Commands is not reached in Debug-Mode anymore. Seems like it got lost with .NET 8Not necessary for the code above, but to have the example more complete here is the code for the
CustomSwipeView
Steps to Reproduce
SwipeItemView
like in the Code-Example above in .NET 7 and see it works and the Commands on theLabel.GestureRecognizers
are working as expectedLabel.GestureRecognizers
with the Command on theLabels
are not working anymoreStarting with the Example Project:
TabView1ViewModel.cs
and navigate to methodprivate async Task ExcludeFromStoreSelectionCommandHandler(StoreSelection storeItemToExclude) { ... }
and set a breakpoint e.g. in line 161StoreSelectionItemView.xaml
SwipeItemView
is not working whereas theSwipeItem
implementation with the sameCommand
binding reaches the breakpointLink to public reproduction project repository
TapGestureRecognizerNotWorking_19630
Version with bug
8.0.3 also tested with 8.0.10-nightly.10061 and it is not working there
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
7.0.101
Affected platforms
iOS, Android, I was not able test on other platforms
Affected platform versions
iOS 16.2, Android with Google Pixel 5 - API 33 (Android 13.0 - API 33)
Did you find any workaround?
No workaround so far. Tried with
HorizontalStackLayout
andGrid
, but not workingRelevant log output
No response