This walkthrough shows how to create ClientUI MVVM Application project with Intersoft ClientUI MVVM Application project template.
This walkthrough demonstrates the following tasks:
- Create a ClientUI MVVM Project using Intersoft MVVM project template.
- Explain the files within Intersoft ClientUI MVVM project.
- Explain the files within Intersoft ClientUI MVVM Application web site project.
You need the following components to complete this walkthrough:
- Silverlight version 4
- Silverlight 4 Tools for Visual Studio 2010
- Visual Studio 2010
- Intersoft ClientUI
Creating a new ClientUI MVVM Project
The new ClientUI MVVM application project is created by using the Intersoft ClientUI MVVM Application project template. Use the following steps to create a new ClientUI MVVM Application project.
To create a new ClientUI MVVM Application project
- Started Visual Studio 2010.
- On the File menu, click New and then Project.
The New Project dialog box appears.
- In the Installed Templates pane, expand the Visual C# or the Visual Basic node and select Silverlight.
- In the list of templates, select Intersoft ClientUI MVVM Application. The following illustration shows an example of the Silverlight project templates.
- Specify a name and a location for the application and then click OK.
The New Silverlight Application dialog box appears as shown in the following illustration.
- Select a method for hosting your Silverlight application.
- Uncheck the Host the Silverlight application in a new Web site check box if you do not want to use a Web site to host your Silverlight application. Instead, an HTML test page will be generated to host your application.
- Check the Host the Silverlight application in a new Web site check box if you want to add a separate ASP.NET Web site or ASP.NET Web Application Project to your solution to host the Silverlight application. If you select this option, you must also specify the New Web project name and New Web Project Type.
- From the Silverlight Version drop-down list, select the Silverlight version 4.
- Click the OK button.
Intersoft ClientUI MVVM Application Project Files
Intersoft ClientUI MVVM Application project contains the following configuration, assembly references, and code files:
- Intersoft ClientUI MVVM Application project contains references to the following assemblies:
- Models folder which contains the following files
ModelBase class is inherit from INotifyPropertyChanged and IDataErrorInfo. MVVM Model pattern class can inherit this ModelBase class
- ViewModels folder which contains the following files
This is the Intersoft DialogBox / Modal Window Service Provider class. This class is used when developer would like to show UXDialogBox.
This is the Intersoft MessageBox Provider class. This class is used when developer would like to show UXMessageBox.
This class is use when developer would like to perform navigation command.
This class is the ViewModel of UXPage1.xaml
This class is inherit from INotifyPropertyChanged. MVVM ViewModel pattern class can inherit this ViewModelBase class
- Views folder which contains the following files
This is the default XAML view in Intersoft ClientUI MVVM Application project.
- MainPage files
The MainPage class is used to create the user interface for the Silverlight application. The MainPage class derives from UserControl. You can implement the MainPage class by using MainPage.xaml for XAML markup and MainPage.xaml.cs for the code-behind.
- App files
The App class is required by a Silverlight application to display the application user interface. The App class is implemented by using App.xaml and App.xaml.cs. The App class is instantiated by the Silverlight plug-in after the application package (.xap file) is created.
Intersoft ClientUI MVVM Application Project Web Site Files
If you check the Host the Silverlight application in a new Web site check box in the New Silverlight Application dialog box, an ASP.NET Web site is created and added to the Silverlight solution. The Web site contains the following files:
- HTML file
An HTML file that is used to configure and instantiate the Silverlight plug-in, which downloads and runs the Silverlight application. The name of this file is a concatenation of the name of the Intersoft ClientUI MVVM Application project and the text "TestPage.html".
- .aspx file
A .aspx file that is the default startup Web page. The name of this file is a concatenation of the name of the Intersoft ClientUI MVVM Application project and the text "TestPage.aspx".
A Web site configuration file.