CommunityToolkit / dotnet

.NET Community Toolkit is a collection of helpers and APIs that work for all .NET developers and are agnostic of any specific UI platform. The toolkit is maintained and published by Microsoft, and part of the .NET Foundation.
https://docs.microsoft.com/dotnet/communitytoolkit/?WT.mc_id=dotnet-0000-bramin
Other
2.8k stars 277 forks source link

IconTintColorBehavior throws exception when navigation happens via Shell Tab and app/system theme is changed #842

Closed KillswitchPrime closed 4 months ago

KillswitchPrime commented 4 months ago

Describe the bug

Add IconTintColorBehavior to an image in a page, then navigate to and from this page using standard shell navigation. Change the theme of the app/system. If you then navigate from the image page using tab navigation, the IconTintColorBehavior will throw an exception.

Here is a minimum reproducible example repo I have created with more info: https://github.com/KillswitchPrime/IconTintColorBehaviorBug

Regression

No response

Steps to reproduce

Clone this repo: https://github.com/KillswitchPrime/IconTintColorBehaviorBug

1. Run project in emulator OR physical device
2. Select "First Group" or "Second Group"
3. Click "Theme" on bottom tab
4. Change theme
5. Click "Main" on bottom tab
6. Click Back (system or top left)
7. Click "Theme" on bottom tab
8. Change theme
9. App crashes

Expected behavior

No exception should be thrown, because there is no unexpected logic or behavior from the app.

Screenshots

No response

IDE and version

Rider

IDE version

2024.1 EAP5

Nuget packages

Nuget package version(s)

8.2.2

Additional context

I've only tested this on Android, so I don't know what other platforms are affected.

Help us help you

No, just wanted to report this

KillswitchPrime commented 4 months ago

Sorry, put this in the wrong repo, should be a Maui issue.