using Microsoft.Phone.Controls;

namespace WPOrientationSample
{
    public partial class MainPage : PhoneApplicationPage
    {
        // Constructor
        public MainPage()
        {
            InitializeComponent();
        }

        private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
        {
            if (e.Orientation == PageOrientation.Landscape ||
                e.Orientation == PageOrientation.LandscapeLeft ||
                e.Orientation == PageOrientation.LandscapeRight
                )
            {
                TitlePanel.Visibility = System.Windows.Visibility.Collapsed;
                ApplicationBar.IsVisible = false;
            }
            else
            {
                TitlePanel.Visibility = System.Windows.Visibility.Visible;
                ApplicationBar.IsVisible = true;
            }
        }
    }
}