Category Archives: Windows 8

Windows 8 Developer Camp

Do you want to get started developing for Windows 8, or is just curious about the what will come?
Did you miss the opportunity to go to Windows 8 Development Camps?
Then check this link out;

There you can download presentations and hands on labs from the Development Camps. Downloads are provided both for C#/XAML and for HTML/CSS/Javascript.

Change theme when developing a Metro app

When creating a Metro-app for Windows 8, you as a developer can choose to use a light or dark theme for the application. For those of you that have previously developed for Windows Phone 7, this is nothing new.

The theme is predefined and when you are using Dark (which is default by the way), the background will be dark and text and so on will be set to light colors. When using the Light theme it is the other way around. You can of course customize everything.

So how do you change from Dark to Light theme for the app?
Here follows one simple example of how to do this.

First, locate your App.xaml-file in your solution. It will be in the root of your project. Open the code behind section and locate the constructor. Then add this line for light theme;
App.Current.RequestedTheme = ApplicationTheme.Light;
or for dark theme use;
App.Current.RequestedTheme = ApplicationTheme.Dark;

The result should now look like:
[sourcecode language=”csharp”]
public App()
//The following line changes the theme for the application. Use ApplicationTheme.Dark for dark theme.
App.Current.RequestedTheme = ApplicationTheme.Light;
this.Suspending += OnSuspending;