-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gestures still don't work on Label Spans #24432
Comments
Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you! Open similar issues:
Closed similar issues:
|
This issue has been verified using Visual Studio 17.12 Preview 1 (8.0.80 & 8.0.3). Can repro on android platform with sample project. |
I cannot reproduce it Screen.Recording.2024-09-01.at.14.14.10.movpublic partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
BindingContext = new MainPageViewModel();
}
}
public class MainPageViewModel : INotifyPropertyChanged
{
public MainPageViewModel()
{
OpenAlertCommand = new Command(()=>{
Application.Current!.MainPage.DisplayAlert("sad","asd","sda");
});
}
public Command OpenAlertCommand{get; set;}
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
} |
Is your version of code necessary? Shouldn't my version work too? It used to work with Xamarin.Forms. |
@CostasAthan Yeah, you're incorrectly using Community Toolkit Rely Command: https://learn.microsoft.com/en-us/dotnet/communitytoolkit/mvvm/generators/relaycommand |
@CostasAthan, the problem is with the relay command's name. When using the RelayCommand attribute, the command is generated by appending Command to the method name. So, in XAML, we need to use the method name with Command appended. If you update your relay command as shown below, it should work correctly.
|
@CostasAthan @karthikraja-arumugam is right! Let us know if it fixes your problem :) |
@karthikraja-arumugam @kubaflo |
Description
This is a problem supposedly solved and closed: #14410, but unfortunately in reality it still exists.
With .NET 8 and targeting Android 34 the gestures still don't work on
Span
tags ofLabels
.I have provided a link to a repository that reproduces the bug.
Steps to Reproduce
No response
Link to public reproduction project repository
https://github.com/CostasAthan/GesturesLabelSpansFailure
Version with bug
Unknown/Other
Is this a regression from previous behavior?
Yes, this used to work in Xamarin.Forms
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 34
Did you find any workaround?
No.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: