CommunityToolkit / CommunityToolkit/Maui
[BUG] StatusBarbehavior ApplyOn OnPageNavigatedTo Not Working
- Dominant language
- C#
- Stars
- 2.7k
- Forks
- 500
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 7
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Did you read the "Reporting a bug" section on Contributing file?
- [x] I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug
### Current Behavior
Perhaps I'm confused as to how this should work but `ApplyOn="OnPageNavigatedTo"` seems to be behaving as if it were `ApplyOn="OnBehaviorAttachedTo"`.
### Expected Behavior
My test program has 2 pages that matter - `MainPage` which sets the status bar background to green and `Page1` which sets it to red. When the program comes up `MainPage` shows a green status bar and navigating to `Page1` will show a red status bar. The problem is that navigating back to `MainPage` will show a red status bar too, not switching back to the green one.
### Steps To Reproduce
1. Open and run the solution from the repository.
2. It should initialize and show this:
3. Navigate to `Page1` it should show:
4. Now navigate to `Mainpage` (aka `Home`), this time it will show a red statusbar instead of a green one:
### Link to public reproduction project repository
https://github.com/david-maw/StatusBar.git
### Environment
```markdown
- .NET MAUI CommunityToolkit:14.0.0
- OS: Android 36
- .NET MAUI Controls: 10.0.31
```
### Anything else?
This isn't urgent for me, working around it in code is fairly trivial.
Contributor guide
Assessment
This issue has not been assessed yet.