-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Question: can you inject NavigationService into the BaseViewModel #443
Comments
What BaseViewModel? Prism doesn't have a BaseViewModel. What platform are you using? |
I am using BaseViewModel : BindableBase, INavigationAware I want to know if I can inject services into my BaseViewModel that every ViewModel inherits I guess I could write an extension to the navigation service to handle the double tap |
You can, but you have to also inject them into your derived class and pass them to your base ctor. Why would you modify the NavigationSevice to handle a double tap? That should be handled by your UI, and you would call a navigation action on the double tap. What platform? |
I am handling the case where the command is invoked faster than it can complete the first tap. I have had issues in apps with the tap gesture and the ability to tap it fast and get multiple pages pushed to the stack |
What platform? |
mostly on android but sometimes on iOS |
Okay, so you are using Xamarin.Forms. Once again, this is not something you will handle in the navigation service. The TabGestureRecognizer has a property that lets you define a double tab called NumberOfTapsRequired. If you want to prevent a double tap, then you need to handle this logic in your ViewModel, not the navigation service. |
ok makes sense like this question |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Is there a way to always have the BaseViewModel inject the NavigationService?
I would like to wrap the functions esp to have a single place to handle double tapping / modals etc
The text was updated successfully, but these errors were encountered: