Skip to content

Instantly share code, notes, and snippets.

@naotaco
Created October 3, 2015 05:12
Show Gist options
  • Save naotaco/e8c5a46d915777b29b54 to your computer and use it in GitHub Desktop.
Save naotaco/e8c5a46d915777b29b54 to your computer and use it in GitHub Desktop.
Detect current screen orientation on UWP application.
private void Page_Loaded(object sender, RoutedEventArgs e)
{
DisplayInformation.GetForCurrentView().OrientationChanged += MainPage_OrientationChanged;
}
private void MainPage_OrientationChanged(DisplayInformation info, object args)
{
Debug.WriteLine("orientation: " + info.CurrentOrientation);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment