[Android] Shell BackButtonBehavior binding Command to valid ICommand causes back button to disappear
See original GitHub issueDescription
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
- File -> New .NET MAUI App
- Create multi-page Shell App
- On SecondPage create
BackButtonBehavior
and bindCommand
to a validICommand
on theBindingContext
:
<Shell.BackButtonBehavior>
<BackButtonBehavior
Command="{Binding BackCommand}"
IsEnabled="True"
IsVisible="True">
<BackButtonBehavior.IconOverride>
<FontImageSource FontFamily="OpenSansSemibold" Glyph="‹" />
</BackButtonBehavior.IconOverride>
</BackButtonBehavior>
</Shell.BackButtonBehavior>
- Run the app and navigate to SecondPage
- Observe back button is not visible
- While app is still running, use Hot Reload to change the
BackButtonBehavior
Command
binding to invalidICommand
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
Issue Analytics
- State:
- Created a year ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Overriding Back Button in Xamarin.Forms Shell…
I've been working on trying to override the back button behavior on Xamairn.Forms Shell recently, both with Navigation bar button and Android ......
Read more >Shell BackButtonBehavior command binding not working ...
When I pressed the back button, the method "GoBackButton" didn't call. I want to mention that on Android works. xamarin · xamarin.forms ·...
Read more >Now that I have shell (working?) it does not respond to the ...
I put in the following code but a back button is not visible on the view that shows the hotdog icon so it...
Read more >Xamarin Forms, the MVVMLight Toolkit and I: taking control ...
In this post of my ongoing series about using MVVMLight with Xamarin Forms, I am going to show you an easy way to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The same happens on .NET 7 SR 1.
Verified this issue with Visual Studio Enterprise 17.7.0 Preview 5.0. Can repro on android platform with sample project. MauiShellNav-main.zip