Closed acaliaro closed 2 months ago
Verified this on Visual Studio Enterprise 17.9.0 Preview 2(8.0.3). Repro on Android 14.0-API34, Windows 11, iOS 17.0 and MacCatalyst with below Project: MauiAppbackbuttonproblem.zip
I think I have a similar problem and it seems to be resolved by setting the binding mode to TwoWay
and I think the reason why this is not working out of the box is because the BackButtonBehaviour bindable property has the default value for the binding mode set to "OneTime". Try setting it to "OneWay"
@samhouts any news on this?
@acaliaro using Mode=OneWay
like this for example IsVisible="{Binding IsBackButtonVisible, Mode=OneWay}
accomplishes what you want :)
Looks like this fix is available in 9.0 preview 7! Thanks!!!
Description
I have a problem with BackButtonBehavior but I can't tell you if it's a problem with MAUI, the MVVM toolkit, or the MAUI toolkit. I have a page that opens in the main page's onAppearing method. A parameter is passed to this page which, in the ApplyQueryAttributes event, sets a property identified as ObservableProperty (IsFirstTime) to true. This property set to true, via the InvertedBoolConverter converter, sets the "IsVisible" of the BackButtonBehavior to false, but the arrow in the navigationbar continues to be seen. If instead of setting the IsFirstProperty to true in the ApplyQueryAttributes method, I set it to true in the SetupViewModel constructor, the arrow disappears correctly.
Steps to Reproduce
run the sample
Link to public reproduction project repository
https://github.com/acaliaro/MauiAppbackbuttonproblem
Version with bug
8.0.3
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 11
Did you find any workaround?
no
Relevant log output
No response