have been doing UWP development recently, in order to save cost and so on contact with Mvvmlight, think it is necessary to send some time to study its usage and implementation principle. If there is a problem or if there is a good suggestion, please bring it up.
With the popularity of mobile development, Mvvmlight is widely used in layered development such as android,ios,wpf,silverlight and UWP. Mvvmlight also supports Xamarin development. Mvvmlight literal meaning is also easy to understand: The lightweight MVVM framework, compared to Microsoft's recent open source prism, is really straightforward. To understand Mvvmlight, you first have to understand the MVVM framework:
Before we explain how it works, we want to look at how to use Mvvmlight in a UWP project.
The first method: Add a Mvvmlight using the project template
1, add mvvmlight template (I have Visual Studio 2015 Enterprise Edition For example, community layout is the same)
Download-"Install-" automatically jumps to its documentation website after installation is complete
Prompt to restart Visual Studio, restart Visual Studio
There are options when you create a new project.
Select the Win10 template to create the project as follows: The directory structure and Viewmodellocator are automatically created.
Second method: Add Mvvmlight.lib Package through NuGet Package Manager
First new project: General-"Blank Application"-"name Mvvmlrn
Right-click the project reference, select Manage NuGet packages
Select the "Browse" tab and enter "Mvvmlightlibs" in the input box
Note: If you want to install the tool input mvvmlight, generally as a package to add the suggestion mvvmlightlibs. The second portable.mvvmlightlibs has not been updated, and the portable DLL is already included in the Mvvmlightlibs.
Select Stable version 5.2.0 on the right, click "Install", the download will pop up after the completion of the Figure 11
There is a reference in the project after the installation is complete
Specific project structure The following section continues ...
Mvvmlight Practice One: If you add the use of Mvvmlight in your project (graphic detail)