Do I have a View Modellococtor, how it works, and what kind of professional / cons to use Is this data compared to templates?
I have tried to find information on Google but there are not many different implementations and no Stratelot list as it is and it is professional / opposition to use it.
intro
In MVVM generally their views models by solving ideas To find out (DI) from the container it automatically occurs when the container is said to provide (see solution) An example of a class container injects a ViewModel parameter in ViewModel view By accepting a manufacturer who watches; The main benefit here is that the container can be configured on with run time instructions how we request it This allows it to resolve the maximum number of test qualifications (scenes and view models) to direct it when we use, when our applications actually run, but the unit tests for the application On run Direct it in different ways. In the latter case the application will also not be a UI (it is not running, it is just a test) so that the container will be resolved at the "normal" type of place, when the application runs. We have seen that the DI approach allows easy testability for application by adding an intangible layer on the creation of application components. There is a problem with this approach: It does not perform well with visual designers such as Microsoft Expression Blend. The problem is that both the common application runs and unit test runs, what is the container with instructions for any solution to set up ; In addition to this, to empower someone to ask for a determination, so that they can injected the voidodels. However, there is no code in our design time running . The designer tries to use the reflection to make an example of our ideas, which means that: ViewModelLocator is an additional abstraction used like this: Of course it means that the scene must be a parlayable constructor to start with (otherwise the designer is not able to instantiate it. ). MODELLOCKER is a phrase that helps you keep the benefits of DI in your MVV application, while allowing your code to play well with Visual Designer is. This is sometimes called the "mixing capacity" (referring to expression blend) of your application. After the above digestion, see a practical example. Finally, using the Data Template option to use a ViewModelLocator, but the option to use explicit view / view model pairs for parts of your UI. Often you can find that there is no need to define view for view model because you can use a data template instead. Benefits of DI
Problems stemming DI
Datacon will be
null then we will get a "blank" view in the designer - which is not very useful
enter ViewModelLocator
SUMMARY
Comments
Post a Comment