Skip to content

[Android] Shell BackButtonBehavior binding Command to valid ICommand causes back button to disappear #7045

@rjygraham

Description

@rjygraham

Description

Binding to a valid ICommand on Shell.BackButtonBehavior causes back button to disappear on Android (maybe iOS as well, no idea on Windows since it is not currently supported).

Steps to Reproduce

  1. File -> New .NET MAUI App
  2. Create multi-page Shell App
  3. On SecondPage create BackButtonBehavior and bind Command to a valid ICommand on the BindingContext:
 <Shell.BackButtonBehavior>
      <BackButtonBehavior
          Command="{Binding BackCommand}"
          IsEnabled="True"
          IsVisible="True">
          <BackButtonBehavior.IconOverride>
              <FontImageSource FontFamily="OpenSansSemibold" Glyph="&#x2039;" />
          </BackButtonBehavior.IconOverride>
      </BackButtonBehavior>
  </Shell.BackButtonBehavior>
  1. Run the app and navigate to SecondPage
  2. Observe back button is not visible
  3. While app is still running, use Hot Reload to change the BackButtonBehavior Command binding to invalid ICommand and observe the back button appears but does nothing since binding is invalid

RC3 reproduction repo can be found here:
https://github.com/rjygraham/MauiShellNav

Reproduction video can be found here:
https://raw.githubusercontent.com/rjygraham/MauiShellNav/main/videos/BackButtonBehavior.mp4

Version with bug

Release Candidate 3 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

Android 11

Did you find any workaround?

None yet

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-shellShell Navigation, Routes, Tabs, Flyoutplatform/androids/needs-verificationIndicates that this issue needs initial verification before further triage will happens/triagedIssue has been reviewedt/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions