using System.IO.IsolatedStorage; using Microsoft.Phone.Controls; namespace MahTweets.Mobile.Core { public class ApplicationOrientation { public static SupportedPageOrientation OrientationLock { get { if (!IsolatedStorageSettings.ApplicationSettings.Contains("OrientationLock")) IsolatedStorageSettings.ApplicationSettings.Add("OrientationLock", SupportedPageOrientation.PortraitOrLandscape); return (SupportedPageOrientation) IsolatedStorageSettings.ApplicationSettings["OrientationLock"]; } set { if (!IsolatedStorageSettings.ApplicationSettings.Contains("OrientationLock")) IsolatedStorageSettings.ApplicationSettings.Add("OrientationLock", value); else IsolatedStorageSettings.ApplicationSettings["OrientationLock"] = value; } } } }