Created
April 3, 2019 08:41
-
-
Save MartinZikmund/960cc264882c44500e31cce9f855bba8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void RefreshDisplayInformation() | |
{ | |
var info = DisplayInfo.GetForCurrentView(); | |
var properties = new PropertyInformation[] | |
{ | |
new PropertyInformation(nameof(DisplayInfo.AutoRotationPreferences), SafeGetValue(()=>DisplayInfo.AutoRotationPreferences)), | |
new PropertyInformation(nameof(info.CurrentOrientation), SafeGetValue(()=>info.CurrentOrientation)), | |
new PropertyInformation(nameof(info.NativeOrientation), SafeGetValue(()=>info.NativeOrientation)), | |
new PropertyInformation(nameof(info.ScreenHeightInRawPixels), SafeGetValue(()=>info.ScreenHeightInRawPixels)), | |
new PropertyInformation(nameof(info.ScreenWidthInRawPixels), SafeGetValue(()=>info.ScreenWidthInRawPixels)), | |
new PropertyInformation(nameof(info.LogicalDpi), SafeGetValue(()=>info.LogicalDpi)), | |
new PropertyInformation(nameof(info.DiagonalSizeInInches), SafeGetValue(()=>info.DiagonalSizeInInches)), | |
new PropertyInformation(nameof(info.RawPixelsPerViewPixel), SafeGetValue(()=>info.RawPixelsPerViewPixel)), | |
new PropertyInformation(nameof(info.RawDpiX), SafeGetValue(()=>info.RawDpiX)), | |
new PropertyInformation(nameof(info.RawDpiY), SafeGetValue(()=>info.RawDpiY)), | |
new PropertyInformation(nameof(info.ResolutionScale), SafeGetValue(()=>info.ResolutionScale)), | |
}; | |
PropertyListView.ItemsSource = properties; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment