jmmontero
jmmontero

Reputation: 169

Control view Stack in MvvmCross

How I handle the view stack?

I use MvvmCross and I don't look up the way to do this.

I have a project, I add a custom SplashScreen that I want remove of view Stack.

Thanks in advance.

Upvotes: 0

Views: 248

Answers (1)

Aboo
Aboo

Reputation: 2454

I don't think there is a direct method to do that for you.

I believe the best way to do this is to create your own custom view presenter and then from within that depending on which platform you are on you can customise your stack of views. For example in iOS you can manipulate MasterNavigationController in a way similar to the answer here.

To find out how to do the custom presenter you can watch N=24 and N=25 in MvvmCross N+1 videos

A general template for an iOS custom view presenter looks like this:

public class CustomPresenter : MvxTouchViewPresenter
{
    public CustomPresenter(UIApplicationDelegate applicationDelegate, UIWindow window)
        : base(applicationDelegate, window)
    {
    }

    public override void Close(IMvxViewModel toClose)
    {
        //your custom code on what to happen when a view model is closing
        base.Close(toClose);
    }

    public override void Show(Cirrious.MvvmCross.Touch.Views.IMvxTouchView view)
    {
        //your custom code on what to happen when a view model needs to be shown
        base.Show(view);
    }
}

Upvotes: 1

Related Questions