Navigation properties throw errors; documentation outdated

I am trying to keep a certain navigation model from going back to previous pages, however CanGoBack property throws an error:

'LinearNavigation' does not have a property called 'CanGoBack' -

PageCount, CanGoBack, CanGoForward, PageProgress: all of them throw the same error as above, but they’re documented here:

Please advise on how to use these properties and provide an example of using WhileCanGoBack or WhileCanGoForward that would keep an user from swiping/navigating back to a previous page.

Related issue:


Those properties are read-only and cannot be set in UX markup, only read in Uno code. It is a mistake to mention them in the UX documentation. I will remove that now.


Fernando: There is currently no simple way of setting up a unidirectional swipe navigation. We’re working on updates to the navigation system which will make this a lot easier.

Until then your only options are:

  • Find out if your usecase is a special case that can be solved with some extra state. For instance, if you only have 2 pages, or if you have multiple pages but only the last one should be “non-reversible”

  • Implement something similar to swipe navigation yourself (in UX) using SwipeGesture (which can be unidirectional) and SwipeAnimation. This requires more work than using a standard pagecontrol or navigator, but is probably the cleanest option if you need it right now.

  • Don’t use swipe navigation. Achieving the one-way only navigation is a lot easier with discrete navigation events. Obviously not ideal.

  • Do some Uno hacking.

And just to explain the WhileCanGo* triggers and CanGo* properties: They don’t let you change any navigation state, they just let you know whether there are other pages available (in front or back of the current one) that you could navigate to if you wanted.