Create an Attached Property you can use on NavigationBars/TabBars/ContentPages/MDP that works like Shell for controlling the behavior of the back button. BackButtonBehavior has a lot more features than the current back button implementation on non Shell.
By adding this property, developers gain more control over the NavigationBar design and it will be a good addition to the TitleView.
Similar to how NavigationPage already has the NavigationPage.HasBackButton property, we should add:
NavigationPage.HasFlyoutButton
NavigationPage.SetHasFlyoutButton()
Should be implemented on all platforms. Should make sure this works with the new Shell as well.
There are a lot of use cases for this one, but first that comes to mind is when creating an edit form in an application; The user enters edit mode and developer want to restrict navigation and replace all the content in the NavigationBar with "Cancel" and "Save"-buttons.
@TobiasKullblikk I updated the ticket a little bit. Let me know your thoughts.
Can you elaborate on this?
Should be implemented on all platforms. Should make sure this works with the new Shell as well.
NavigationPages aren't really used with Shell
@PureWeen Looks great. Was not aware of BackButtonBehaviour.
Can you elaborate on this?
Sorry for the confusion. I really like the idea of Shell, and wanted to make sure this feature would work with it too. I just haven't had the time to dive into it yet.
Let me know if I can contribute on implementing this one (if accepted) 👍
note that this would help Prism as well. We'd love to see some priority put on this.
@samhouts , how's the consideration going on? Would really like to see this enhancement gets implemented
The API for BackButtonBehavior should get reworked with this
API ideas for this
Everything gets broken out to attached properties
As this is implemented code is generalized to NavigationPageRenderer/MasterDetailsPage on respective platforms
NavigationPage can acquire all the backbutton attached properties as well just replace the word Shell with NavigationPage
MasterDetailsPage can acquire all the flyout properties
```C#
public enum FlyoutIconDisplayOptions
{
FirstPageOnly,
Visible,
Hidden,
}
public enum BackButtonDisplayOptions
{
AfterFirstPageOnly,
Visible,
Hidden,
}
Shell.FlyoutDisplay //Attached Property
Shell.BackButtonDisplay //Attached Property
Shell.BackButtonCommand
Shell.BackButtonCommandParameter
Shell.BackButtonIsEnabled
Shell.BackButtonText
Shell.BackButtonIcon
Shell.FlyoutCommand
Shell.FlyoutCommandParameter
Shell.FlyoutIsEnabled
Shell.FlyoutText
Shell.FlyoutIcon
```
Most helpful comment
note that this would help Prism as well. We'd love to see some priority put on this.