cancel
Showing results for 
Search instead for 
Did you mean: 

MDK: What does the BackStackVisible navigation property do exactly?

vtschouten97
Explorer
0 Kudos
118

In the MDK documentation, the following is said about the BackStackVisible navigation property: 

'If set to true, MDK records the user navigation in the backstack, allowing the users to navigate back to a page when they press the back button. If set to false, the user navigation will not be recorded, and the user won’t have an option to navigate back to the previously accessed subpages.'

I have set the BackStackVisible property to false in multiple navigation actions in SSAM, with the expectation that the back button will not be visible. Setting the property to false had no effect whatsoever. The back button is still visible in the page specified in the PageToOpen navigation property, or in all subsequent navigations away from that page.

We would like to signal the user that navigating back will have certain consequences, and this should also be reflected in the caption of the back button. So the idea was to hide the back button using the BackStackVisible navigation property, and add an actionbar item which ultimately does the same job as pressing the back button. How can we achieve this? If it were possible to change the caption of the back button, then we could achieve the same using the OnBackButtonPressed page property, but I don't think it's possible to change the back button caption.

Using MDK24.4.3 with SSAM2310, Plugins 2405.0.4

View Entire Topic
bill_froelich
Product and Topic Expert
Product and Topic Expert

BackStackVisible controls if the destination page of the Navigation action will be added to the stack of open pages. For example

Page A -> Nav (BackStack False) -> Page B -> Nav -> Page C

In this example when navigating from A to B the Back button will be there and clicking it will return you to Page A.  However, if you start at Page A, nav to Page B and then Nav to Page C.  Clicking the Back button will not take you to Page B (because BackStackVisible was False) but instead take you back directly to Page A.

This can be useful if you have "wizard" type flow requiring multiple pages where you don't want the user to be able to return to the previous page once you leave it.

Regarding your requirement to signal the user that navigating back will have consequences, that is where you can use OnBackButtonPressed.  This event will trigger before the app navigates back to the previous page.  This allows you to save state or even stop the navigation.  You could display a message box to tell the user about the situation and give them a choice to continue navigating back or remain on the current page.

vtschouten97
Explorer
0 Kudos
Thanks for the clarification Bill!