Monday 15 September 2014

xamarin.ios - How to show a View for an existing instance of a ViewModel with MvvmCross? -


I think the title of my question is very clear, for information I am using MvvmCross vNext. I know that I should use V3, but I'm still slow because this version is made every week ... I like to wait for a real stable version.

I am in a case that we represent NetworkViewModel to represent a network. It is also responsible for checking connection status on the server. If the connection is closed, View MODEL will post a login message in which my view is subscribed. When you get it, I as a dialog (mono touch. Dialog, but is linked to my Wumold, so that a MvxTouchDialogViewController) my Netvrkwumodel I show as a model view (I'm using MvxModalSupportTouchViewPresenter) I am To be able to create my own dialog on the same view modal, I have applied it to MvxUnconventionalViewAttribute so it can be stopped at the startup to register 2 on the same ViewModel type. Then I use an MvxShowViewModelRequest to make an example of my MvxTouchDialogViewController and present it with the show method of my presenter.

My problem is that in this case, a new example of my networkviewmodel is designed to engage my dialogue. Or do I want to reuse the same networkviewmodel instance for my modal dialog.

Current behavior is possible by using bindling inflight method on the currentmodule and specifying the login dialog xml layout file.

If you want to override the mvx behavior If it can not always create a new view-model, you can override the view-modal locator to provide a custom view-modal lookup for one or more viewable types.

See this question / answer for more information -

No comments:

Post a Comment