Reputation: 1570
I have trouble when I have to delete navigation stack until to determined page. I couldn’t find any feasible solution without NoHistory option. I can remove some pages which have been opened on main page with nohistory attribute but I need another things.
I can explain my problem better with an example. Imagine that I have 5 different pages and the navigation stack’s state is 1 > 2 > 3 > 4 > 5. Third page should be opened when particular button is pressed on page of 5. Actually the navigation stack’s new state should be 1 > 2 > 3.
How can I apply that operation, please could someone add suggestion for this?
Xamarin Forms version is 3.6.364807 MvvmCross version is 6.2.3.
Upvotes: 0
Views: 1510
Reputation: 3916
I don't know which version of mvx you are using but if it's one of the last ones you can do:
this.navigationService.ChangePresentation(new MvxPopPresentationHint(typeof(MyThirdViewModel));
This will pop every viewmodel until the third one.
Here you have the hint in the repo
If you don't have that hint because of using a previous version of mvx you can refer to this question to have an idea of how to implement a custom hint.
HIH
Upvotes: 2