Keywords: WPF. Net C # mvvm light Toolkit framework Visual Studio 2010 vs2010 expression blend 4 getting started tutorial New Practice
3. viewmodel and view
Next, I plan to use the viewmodel OF THE mvvm light Toolkit framework on the simplest login logon interface.
1. Add a new item to the viewmodel directory of the merged project, select the "mvvmviewmodel (WPF)" file template, and name it loginviewmodel. CS.
2. Open viewmodellocator. Cs in the viewmodel directory, start a new line under the constructor, enter "mvvmlocatorproperty", press the tab key, get the code snippet template, and change the default name to loginviewmodel.
3. After completing the code snippet template, delete the redundant cleanup () method (if any) and the original constructor and cleanup () add the corresponding create and clear methods to the method.
4. the login logon interface for view is implemented by page. In blend 4, open loginpage. XAML and bind its datacontext to loginviewmodel, 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/03/2034892.html
Keywords: WPF. Net C # mvvm light Toolkit framework Visual Studio 2010 vs2010 expression blend 4 getting started tutorial New Practice
3. viewmodel and view
Next, I plan to use the viewmodel OF THE mvvm light Toolkit framework on the simplest login logon interface.
1. Add a new item to the viewmodel directory of the merged project, select the "mvvmviewmodel (WPF)" file template, and name it loginviewmodel. CS.
2. Open viewmodellocator. Cs in the viewmodel directory, start a new line under the constructor, enter "mvvmlocatorproperty", press the tab key, get the code snippet template, and change the default name to loginviewmodel.
3. After completing the code snippet template, delete the redundant cleanup () method (if any) and the original constructor and cleanup () add the corresponding create and clear methods to the method.
4. the login logon interface for view is implemented by page. In blend 4, open loginpage. XAML and bind its datacontext to loginviewmodel, as shown in the following two figures.
Compiled.