Skip to content
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

Disable pointer hover on mobile platforms #1500

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/MAUI/Maui.Samples/Views/CategoryPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ private async void SearchClicked(object sender, EventArgs e)
await Navigation.PushAsync(new SearchPage(), false);
}

// The favorites icon can flicker when using a pen as pointer.
private void PointerGestureRecognizer_PointerEntered(object sender, PointerEventArgs e)
{
#if WINDOWS || MACCATALYST
var view = (Border)sender;

var grid = (Grid)view.Content;
Expand All @@ -79,10 +81,12 @@ private void PointerGestureRecognizer_PointerEntered(object sender, PointerEvent
imageButton.IsVisible = true;

Console.WriteLine("PointerRecognized");
#endif
}

private void PointerGestureRecognizer_PointerExited(object sender, PointerEventArgs e)
{
#if WINDOWS || MACCATALYST
var view = (Border)sender;

var grid = (Grid)view.Content;
Expand All @@ -92,6 +96,7 @@ private void PointerGestureRecognizer_PointerExited(object sender, PointerEventA
string sampleName = (string)imageButton.CommandParameter;

imageButton.IsVisible = false || SampleManager.Current.IsSampleFavorited(sampleName);
#endif
}

protected override void OnNavigatedTo(NavigatedToEventArgs args)
Expand Down
Loading