CommunityToolkit / Maui

The .NET MAUI Community Toolkit is a community-created library that contains .NET MAUI Extensions, Advanced UI/UX Controls, and Behaviors to help make your life as a .NET MAUI developer easier
https://learn.microsoft.com/dotnet/communitytoolkit/maui
MIT License
2.09k stars 337 forks source link

[BUG] [Android] DrawingView binding fails after switching tab #1879

Open kramer-e opened 2 weeks ago

kramer-e commented 2 weeks ago

Is there an existing issue for this?

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

DrawingView bindings work as expected when starting the app, but after switching the binding is no longer working on Android. On iOS the DrawingView works as expected, also after switching tabs.

Expected Behavior

DrawingView bindings like Lines and DrawingLineCompletedCommand keep working after switching tabs.

Steps To Reproduce

  1. Open and run reproduction project on Android.
  2. Draw line and observe that binding works.
  3. Switch to second tab.
  4. Switch back to main (first) tab.
  5. Draw line and observe that binding fails.

Link to public reproduction project repository

https://github.com/kramer-e/DrawingView_Bug

Environment

- .NET MAUI CommunityToolkit: 8.0.0 & 9.0.0
- OS: Android 14 (API 34)
- .NET MAUI: 8.0.21

Anything else?

No response

jeroen-corteville commented 4 days ago

I'm running into the same issue. When using Windows it's even worse, the control just fully disappears.

kramer-e commented 4 days ago

I'm re-adding the control now in OnAppearing, but this is not a really elegant workaround.