Create a modern UI app using the project template
Before doing this, make sure that the modern UI for WPF templates extension for Visual Studio 2012 is installed.
- Download and install the vsix extension fromVisual Studio Gallery
Or
- In Visual Studio 2012, open the Extension Manager (Tools>Extensions and updates)
- SelectOnline>Visual Studio GalleryAnd search'Modern UI'
- SelectModern UI for WPF templatesAnd clickDownloadTo download and install.
1. Create a new project and select a new template: Modern ui wpf Application
This applicationProgramThe template contains two pages: Home. XAML and setting. XAML and mainwindow. XAML.
The settings page provides some style setting options. Pages are usually placed in the pages project folder. The content folder is often used by standard WPF user controls to be referenced by various pages.
2. Compile and run the program. You can see the following results:
3. Right-click the pages folder and selectAdd> new project... Add a new basic layout page. In the Add new project dialog box, select basic page from the modern UI for WPF list. Name basicpage. XAML and click Add
4. reference the new page to the main menu. Open mainwindow. XAML and find the Mui: modernwindow. menulinkgroups Element Definition main menu. Add a new link to the menu group and name it "welcome" as follows:
"
welcome
"
"
Home
" source =
"
/pages/home. XAML
"/>
"
my page
" source =
"
/pages/basicpage. XAML
"/>
...
5. Compile and run the program. Select the my page option in the main menu. You can see the following results:
In this way, a new modern UI application project is created and the page is added using the visusal studio extension template. Point to a new page by adding a link.