Skip to content

[BUG] StatusBarbehavior ApplyOn OnPageNavigatedTo Not Working #3081

@david-maw

Description

@david-maw

Is there an existing issue for this?

  • I have searched the existing issues

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

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:
Image
  1. Navigate to Page1 it should show:
Image
  1. Now navigate to Mainpage (aka Home), this time it will show a red statusbar instead of a green one:
Image

Link to public reproduction project repository

https://github.com/david-maw/StatusBar.git

Environment

- .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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions