Mvvmlight Practice 1: If Mvvmlight is added to a project ),
I have been working on UWP Development recently. In order to save costs and so on, I feel it is necessary to study its usage and implementation principles at a time. If you have any questions or have good suggestions, please submit them.
With the popularity of mobile development, Mvvmlight is widely used in hierarchical development such as Android, Ios, WPF, Silverlight, and UWP. Mvvmlight also supports Xamarin development. The Mvvmlight literal meaning is also easy to understand: the lightweight Mvvm framework, compared with Microsoft's recent open-source Prism, is indeed easy to understand. To understand Mvvmlight, you must first understand the MVVM framework:
Before explaining its principles, let's look at how to use Mvvmlight in the uwp project.
Method 1: Add Mvvmlight using the project template
1. Add the Mvvmlight template (I have already used Visual Studio 2015 Enterprise Edition as an example, and the community layout is the same)
Download-install-automatically jump to its instruction documentation website after installation
Prompt to restart Visual Studio and restart Visual Studio
There are options when creating a project.
Select the Win10 template to create the project as follows: both the directory structure and ViewModelLocator are automatically created.
Method 2: Use the Nuget Package Manager to add the Mvvmlight. lib package
Create a project first: general-blank application-name MvvmLrn
Right-click the project reference and choose manage Nuget packages]
Select the Browse tab and enter Mvvmlightlibs in the input box]
Note: If you want to install the tool, enter Mvvmlight. We recommend that you add Mvvmlightlibs as a package. The second Portable. Mvvmlightlibs is no longer updated, and the Portable DLL is included in Mvvmlightlibs.
Select stable version 5.2.0 on the right side, and click Install. After the download is complete, the figure 11 is displayed.
After the installation is complete, there will be references in the project.
Continue in the next section of the specific project structure...