Windows Phone 8 : changes in MainPage.xaml.cs

Hi all,

I would like to handle phone rotation on Windows Phone (for some gameplay behaviour) but i don’t want Unity to be allowed to rotate from landscape to portait.
I either don’t want to have a class with an Update() function checking for Input.DeviceOrientation.

I found a method in MainPage.xaml.cs (PhoneApplicationPage_OrientationChanged) which does exactly what I want, but if I modify this file, I need to change it every time I build my application.

Does someone know if there is a place I can put the modified file in the Unity project (like for AppController.mm for iOS) who will replace the Unity’s one by my own ? or should I copy the modified file myself in a BuildPostProcess function ?

you wont need to change this everytime. As the new build from Unity will just replace data folder, and not your xaml files.

Finaly, we fixed this problem by adding the file in an editor folder with a BuildPostProcess to copy the file at each build.

You can see the reasons about this choice in my comment to @neerajcrespo answer.