WPF ModernUI Tutorial Part 1

Introduction

ModernUI is a nice WPF theme and a styling framework which let you build a modern, beautiful application easily. Are you poor in designing skill and have problem with designing GUI for your WPF applicaiotn? If so, you have to try ModernUI, it is the best choice for you. In web design, there is Bootstrap for building great UI. And for WPF, it is Modern UI.

 

Screenshots

 

Installation

The installation is really easy, just search “ModernUI” in Manage NuGet Package Window, and select “ModernUI for WPF” item and click “Install”

Install ModernUI for WPF in NuGet Package Manager

Install ModernUI for WPF in NuGet Package Manager

Or run following command in Package Manager Console

 Install-Package ModernUI.WPF

 

Create a ModernUI Window

First create a new WPF Application Project named “ModernUISample”. After creating project, select MainWindow.xaml, change the XAML as following:

The ModernWindow class is defined under FirstFloor.ModernUI.Windows.Controls, so add following line to MainWindow.xaml.cs to import this namespace

Then let MainWindow inherit from class ModernWindow

 

Click “Debug” button to run the program, we will see a black rectangle with a light blue border is shown. What’s wrong with it? It’s because that we have not applied the theme files to our application.

Open App.xaml, and add following code:

 

 

Run the program again, you will see a modern window is shown

Modern UI blank window

Cannot Open File ‘MSCOREE.lib’

When I’m trying to compile the C++/CLI project in Visual Studio 2013, I got an error saying

cannot open file ‘MSCOREE.lib’

This post said MSCOREE.lib is removed from Visual studio 2008, but I’m not sure it’s also working for Visual Studio 2013.

After searching a while, I found this file is located at C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib. Adding this path to Additional Library Directories property value will solve this problem.

Open Project Properties, Linker, General Page and select Additional Library Directories configuration property

Open Project Properties, Linker, General Page and select Additional Library Directories configuration property