Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling PushPageModel outside of page model #43

Closed
OpticNectar opened this issue Feb 19, 2016 · 5 comments
Closed

Calling PushPageModel outside of page model #43

OpticNectar opened this issue Feb 19, 2016 · 5 comments

Comments

@OpticNectar
Copy link

How can I call PushPageModel or something similar outside of a page model? There are times I need to call it from a menu that has it's own View Model that does not inherit and cannot inherit from FreshBasePageModel. I'm using http://xam-consulting.com/slideoverkit-xamarin-forms/ in case you are wondering.

@rid00z
Copy link
Owner

rid00z commented Feb 19, 2016

So you might need to get the navigation service out of the IOC container
and push it yourself?

It kind of depends. what type of navigation do you have?

On Friday, 19 February 2016, OpticNectar notifications@github.com wrote:

How can I call PushPageModel or something similar outside of a page
model? There are times I need to call it from a menu that has it's own View
Model that does not inherit and cannot inherit from FreshBasePageModel.
I'm using http://xam-consulting.com/slideoverkit-xamarin-forms/ in case
you are wondering.


Reply to this email directly or view it on GitHub
#43.

Michael Ridland | Technical Director | Xamarin MVP

XAM Consulting - Mobile Technology Specialists

www.xam-consulting.com

Blog: www.michaelridland.com

@OpticNectar
Copy link
Author

Is there an example of how to do that somewhere? I haven't worked with IOC containers much, and i'm not sure how to go about that.

@rid00z
Copy link
Owner

rid00z commented Feb 21, 2016

@OpticNectar

It really depends on your overall navigation.

var navService = FreshMvvm.FreshIOC.Container.Resolve<IFreshNavigationService> (FreshMvvm.Constants.DefaultNavigationServiceName);
var page = FreshPageModelResolver.ResolvePageModel<MyPageModel> ();
navService.PushPage (page, null);

@OpticNectar please feel free to email me michael@xam-consulting.com

@JoshuaNovak919
Copy link

@rid00z That seemed to have worked perfectly. Thanks!!

@rid00z rid00z closed this as completed May 5, 2016
@jzhouw
Copy link

jzhouw commented Nov 3, 2016

@rid00z I have similar question like the one in this thread:

  1. my app main page is a MasterDetail which uses FreshMvvmMasterDetailNavigation already
  2. when app not running, and a push notification coming, I want the app to open a specific Detail page still with the Master menu at right side as normal app launch does

To handle the push on app launching, I need to check the push data to decide which page to open, so there would be some work in iOS's AppDelegate.FinishedLaunching, how can I implement this with FreshMvvm and/or forms navigation service?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants