1. WPCentral Question's Avatar
    Hi all,

    I am new to wp8 developing and would like to set my app to only work in landscape mode is this possible?
    09-28-2014 11:36 PM
  2. Aresjr21's Avatar
    You might want to post this question into the developers thread instead to get the best possible response to your inquiry. Developers Corner
    09-29-2014 03:36 AM
  3. azcruz's Avatar
    I have the code but don't have my Surface with me. I'll post later if somebody else hasn't done so.


    Sent from my iPhone using Tapatalk
    09-29-2014 03:39 AM
  4. azcruz's Avatar
    Here's the stripped down version of one of my code...

    [CODE]
    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;
    }
    }
    }
    [/CODE]

    You can replace this

    this.SupportedOrientations = locked ? SupportedPageOrientation.Portrait : SupportedPageOrientation.PortraitOrLandscape;

    with this

    this.SupportedOrientations = SupportedPageOrientation.Portrait;
    09-29-2014 08:36 AM

Similar Threads

  1. Replies: 3
    Last Post: 08-30-2015, 03:22 PM
  2. Replies: 5
    Last Post: 09-29-2014, 09:24 AM
  3. Replies: 1
    Last Post: 09-29-2014, 02:18 AM
  4. Replies: 1
    Last Post: 09-28-2014, 09:14 PM
  5. How do i approve tags from the facebook app?
    By rizzo183 in forum Applications
    Replies: 1
    Last Post: 09-28-2014, 08:38 PM
LINK TO POST COPIED TO CLIPBOARD