This project is read-only.

Using Metro Style in an Application

Using Styles

To use metro style in your WPF apps, add the following resource dictionaries into the App.xaml of you application.
There're several themes shipped with this lib, the dark theme and the light theme. Below are the code to apply one theme to your app.
For example, add this resource dictionary for dark theme:
<ResourceDictionary Source="pack://application:,,,/MetroWPF;component/Themes/Dark.xaml"/>
Add this one for light theme:
<ResourceDictionary Source="pack://application:,,,/MetroWPF;component/Themes/Light.xaml"/>
Then, this resources dictionary of Control styles should be added:
<ResourceDictionary Source="pack://application:,,,/MetroWPF;component/Themes/ControlStyles.xaml"/>
Go here to see more themes

Using Controls

Metro WPF provides some controls that WPF doesn't provide, to use them, add the following xml namespace to the root element of your .xaml file:
xmlns:m="http://metrowpf.codeplex.com/controls"
and you can use the metro controls with m: prefix:
<m:ProgressRing/>

Last edited Jun 18, 2013 at 1:36 AM by HenryZhu, version 2

Comments

dizzley Jan 13, 2015 at 1:08 PM 
To add both theme resource files into App.xaml, you can use the syntax:
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MetroWPF;component/Themes/Dark.xaml"/>
<ResourceDictionary Source="pack://application:,,,/MetroWPF;component/Themes/ControlStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

HenryZhu Aug 13, 2013 at 4:50 PM 
Hi Ebrahim,
you just need to add the resource dictionaries above into your App.xaml. and use your controls as normal. the styles will be applied to your controls automatically. BTW, we are preparing a new release which will contain a demo project as well.
thanks/henry

Ebrahim_rad Jul 11, 2013 at 4:41 PM 
Hi
i downloaded your files and imported in my project
But
i don't know how to use it in my code exactly.
if any body can make an example it will be a very great help to me,
thanks in advance.