GithubHelp home page GithubHelp logo

Comments (2)

damirarh avatar damirarh commented on August 16, 2024

Imported comment written by James Lavery on 2018-10-15T09:58:42

Although this post is over 4 years old, it's still very useful!

I have a couple of questions though:
* How are you setting up your ViewModel with regard to injecting the navigation service?
* Is NavigationCommand must be using the Navigation service - so is this being mocked? Or is the call to the Navigation service being intercepted by the MockDispatcher?

from damirscorner-utterances.

damirarh avatar damirarh commented on August 16, 2024

Imported comment written by Damir Arh on 2018-10-20T06:35:35

I don't remember the details after all this time, but I took another look at the project I based the blogpost on.

As far as I can see, there's no direct interaction with navigation service in my code. All the navigation is implemented by calling ShowViewModel method on the MvxViewModel base class of all my view models. It is implemented in the MvxNavigatingObject base class.

Here's an example of a command definition:


PlayersEditorCommand = new MvxCommand(() => ShowViewModel<playerseditorviewmodel>());

The ShowViewModel method implementation must be obtaining the instance of the MockDispatcher using Ioc when it requests IMvxViewDispatcher. That's why the navigation calls are intercepted by that class and I can then verify which were made.

from damirscorner-utterances.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.