thielj / MetroFramework

Metro UI of Windows 8 for .NET Windows Forms applications
http://thielj.github.io/MetroFramework
Other
396 stars 225 forks source link

Better documentation for Custom Themes #9

Open eklam opened 10 years ago

eklam commented 10 years ago

I'm trying to create a custom theme, I copied it from Light, and changed some values. I put my themes.xml in main project folder AND solution folder, but I still don't know how to use it (in design or in run-time).

thielj commented 10 years ago

At design time, you would normally work with the default theme. However, you should be able to add a MetroStyleManager component to your form and choose your custom theme (note: this will persist the theme used for this particular form!).

The other option is to change the default theme in themes.xml, e.g.

<themes default='Custom'>

The designer will try to load the themes.xml file from the solution folder as this was the only folder which I managed to locate through the design host (see MetroStyleManagerDesigner.Initialize). This will only work once the solution is saved.

At run-time, themes.xml is loaded from the application folder (see MetroStyles.Create).

If you want to debug this, you might want to add some Trace.WriteLine statements to the Initialize method and Create methods. DebugView (http://technet.microsoft.com/en-us/sysinternals/bb896647) might come handy here if you are not using any other logging framework.

dangnhapnee commented 9 years ago

@thielj video please! i can't create a custom theme