using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using SolidColorBrush = System.Windows.Media.SolidColorBrush;
namespace <yourapp namespace>
{
public partial class SettingsPage : PhoneApplicationPage
{
private static AppSettings settings;
public SettingsPage()
{
InitializeComponent();
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
settings = new AppSettings();
bool locked = settings.OrientationLockSetting;
bool useAccent = settings.UseThemeColorSetting;
SetOrientation(locked);
base.OnNavigatedTo(e);
}
private void SetOrientation(bool locked)
{
this.SupportedOrientations = locked ? SupportedPageOrientation.Portrait : SupportedPageOrientation.PortraitOrLandscape;
}
}
}