Modern UI For WPF Application by Example (Default Window)


The purpose of this article is to show how to create a basic default Window in WPF using the Modern UI.


The Modern UI is a set of controls and styles converting our WPF application into a great looking Modern UI app. The Modern UI project can be found in Here it is possible to get the WPF app that demostrates the features provided by “mui”.


In the article My first Modern UI app it is possible to create the default Window from “mui”, that is defined by default with a back button and some options/sub options that show the respective content.

Here is the look:

group 1

Whoever wants to run a simple sample based in the article above, see the sample in github.

Here the MainWindows is defined by:

  1. <mui:ModernWindow x:Class="ModernUIForWPFSample.DefaultModernUI.MainWindow"  
  2.                   xmlns=""  
  3.                   xmlns:x=""  
  4.                   xmlns:mui=""  
  5.                   Title="Default Modern UI Window"  
  6.                   Width="650"  
  7.                   Height="450"  
  8.                   IsTitleVisible="True">  
  9.     <mui:ModernWindow.TitleLinks>  
  10.         <mui:Link DisplayName="ModernUI Project" Source="" />  
  11.         <mui:Link DisplayName="ModernUI For WPF Sample" Source="" />  
  12.     </mui:ModernWindow.TitleLinks>  
  14.     <mui:ModernWindow.MenuLinkGroups>  
  15.         <mui:LinkGroup DisplayName="Helper">  
  16.             <mui:LinkGroup.Links>  
  17.                 <mui:Link DisplayName="Steps" Source="/Views/StepsControl.xaml" />  
  18.                 <mui:Link DisplayName="Other resources" Source="/Views/ResourcesControl.xaml" />  
  19.             </mui:LinkGroup.Links>  
  20.         </mui:LinkGroup>  
  21.     </mui:ModernWindow.MenuLinkGroups>  
  22. </mui:ModernWindow>  
There are two title links at the top based in the Web URL and there is a menu link group that contains only two link groups, Steps and Resources, that are UserControls.

  1. TitleLink and LinkGroup allow definition of a path for a Web URL or for a Control/User Control/Window.
  2. It is necessary to add the themes from the Modern UI to the App.xaml.

When we run the sample we will have something like:


Note: the image above has the entire procedure.

other resource

To define the theme color for the window, we need to define the color in the constructor, by doing:

  1. AppearanceManager.Current.AccentColor = Colors.Green;  
To select the first view that will show we need to do something like:
  1. ContentSource = MenuLinkGroups.First().Links.First().Source;  
Source Code

Get the source code for this sample in github.

Visual Studio Extension used