New WPF practice 2: mvvm light Toolkit (2. Create an mvvmlight Project)

Source: Internet
Author: User
Tags visual studio 2010

Keywords: WPF. Net C # mvvm light Toolkit framework Visual Studio 2010 vs2010 expression blend 4 getting started tutorial New Practice

2. Create an mvvmlight Project

After mvvm light toolkit is installed, you can find the five project templates starting with "mvvmlight" in the new project list of vs2010. Because I want to port an original WPF project to the mvvm light Toolkit framework, I chose to create a new "mvvmlight (wpf4)" project.

The default structure of the newly created mvvmlight project is as follows: App. XAML, app. XAML. CS, and viewmodellocator. CS.

Move the existing project files to the newly created mvvmlight project. In addition to the necessary namespace, properties, and reference changes, there are two areas that need special attention: the first is to apply the mvvmlight project app. A sentence about viewmodellocator in XAML is merged into an existing project app. in XAML, the second is to apply the mvvmlight project app. XAML. C # About dispatcherhelper in Cs # merge to an existing project app. XAML. CS, as shown in the following two figures.

Compiled.

Author: Li fengtong; Source: http://www.cnblogs.com/phoenixtrees. Http://www.cnblogs.com/phoenixtrees/archive/2011/05/02/2034301.html

Keywords: WPF. Net C # mvvm light Toolkit framework Visual Studio 2010 vs2010 expression blend 4 getting started tutorial New Practice

2. Create an mvvmlight Project

After mvvm light toolkit is installed, you can find the five project templates starting with "mvvmlight" in the new project list of vs2010. Because I want to port an original WPF project to the mvvm light Toolkit framework, I chose to create a new "mvvmlight (wpf4)" project.

The default structure of the newly created mvvmlight project is as follows: App. XAML, app. XAML. CS, and viewmodellocator. CS.

Move the existing project files to the newly created mvvmlight project. In addition to the necessary namespace, properties, and reference changes, there are two areas that need special attention: the first is to apply the mvvmlight project app. A sentence about viewmodellocator in XAML is merged into an existing project app. in XAML, the second is to apply the mvvmlight project app. XAML. C # About dispatcherhelper in Cs # merge to an existing project app. XAML. CS, as shown in the following two figures.

Compiled.

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.