Windows phone7-MVVM Mode

Source: Internet
Author: User

Note: the author of the blog http://www.galasoft.ch/mvvm/ from Laurent Bugnion provides a detailed introduction to the video and part of the samples source code (English), mvvm light toolkit also corresponds to the source code on codeplex, in the introduction video, Laurent introduced in detail the features, applications, and data message processing of the Model-View-viewmodel model. It is a good teaching material for mvvm learning;

As described in the Laurent blog, mvvm separates mode from view in SL, WPF, and WP7 to create simple, easy-to-maintain, and scalable applications.Program; Strong testability (view and model separation can be used for unit tests on the model), strong usability of the UI; the ease of use of the UI is mainly reflected in the ability to quickly design the interface in expression blend, in addition, toolkit provides data during design hours for UI designers to conveniently view the display of many data controls in the design UI (this will be introduced in the following chapter ); here I will introduce some of my understanding of the mvvm model.

1. mvvm mode structure

This is the MVC mode, which achieves the separation of view and model. Different view displays can be developed for the same model, and the model can be easily tested. The controller can manage requests and perform logical processing;

This is the mvvm mode. It has completely isolated the model and view, and the presentation model controls the program logic. Therefore, viewmodel can be tested independently;

2. Interaction between view and Mode

The viewmodel data is mainly displayed through databinding between the view and viewmodel, And the view can notify the viewmodel data changes (set binding mode );

User operations (such as click of a button) Notify viewmodel of logical processing by binding the corresponding command; commands will be detailed in the following sections;

Viewmodel updates the display of views through messages; model is used as a data processing component;

 

Environment Configuration:

If you have configured the WP7 development environment, install

Mvvm light toolkit V4 beta1 is ready. It includes SL, WPF, WP7 application templates, and components in toolkit;

If you have not configured the WP7 development environment, please refer to the Environment configuration in http://www.cnblogs.com/yoainet/archive/2011/12/02/2272479.htmlto install

After installation, you will have the following templates in vs2010:

Mvvm Silverlight

 

Mvvm WP7

 

Mvvm WPF

 

Now, we can start the mvvm development journey.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.