If you have started to play with the WinRT /Win8 developer preview bits you have noticed that there are several project templates to choose from:
- Application
- Grid Application
- Split Application
- Class Library
- Unit Tests (finally they get the idea that testing is important)
One thing that you need to pay attention to if you pick the empty 'Application' Template is that by default the initial rotation of the UI is set to Portrait (this is true for the Developer Preview, may not be true in future builds). Having the UI set to Portrait is great if that is your intent, however I am going to speculate that most apps should start in Landscape mode.
Of course you can set the default or supported orientation for each view in your application, but you should also set the default orientation at the project level as well to avoid disorientating your user if it starts in one orientation and suddenly switches to another.
To change the default orientation in the application you need to do the following:
- Find the Package.AppManifest file in your project and double click on it
- Scroll to the very bottom of the page, look for the 'Initial Rotation' combo box
- Change the initial rotation to the rotation/orientation you desire. In most cases I assume this will Landscape.
There you have it,this is how you set the default Initial Rotation for you C# Metro Application.
Till next time,
Posted
09-24-2011 7:06 AM
by
Derik Whittaker