Skip to content

Instantly share code, notes, and snippets.

@colinkiama
Forked from naotaco/detect_orientation.cs
Created January 21, 2018 23:53
Show Gist options
  • Save colinkiama/cdcef9d8a3e9099b221a41a5be3b0000 to your computer and use it in GitHub Desktop.
Save colinkiama/cdcef9d8a3e9099b221a41a5be3b0000 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