return s_dpi.Value / 72.0 / Elementary.GetScale();
});
- static Lazy<DeviceOrientation> s_naturalOrientation = new Lazy<DeviceOrientation>(() =>
- {
- int width = 0;
- int height = 0;
- TSystemInfo.TryGetValue<int>("http://tizen.org/feature/screen.width", out width);
- TSystemInfo.TryGetValue<int>("http://tizen.org/feature/screen.height", out height);
-
- if (height >= width)
- {
- return DeviceOrientation.Portrait;
- }
- else
- {
- return DeviceOrientation.Landscape;
- }
- });
-
class TizenDeviceInfo : DeviceInfo
{
readonly Size pixelScreenSize;
private set;
}
- public static DeviceOrientation NaturalOrientation => s_naturalOrientation.Value;
+ public static DeviceOrientation NaturalOrientation { get; } = GetDeviceOrientation();
public static StaticRegistrarStrategy StaticRegistrarStrategy => s_staticRegistrarStrategy;
private set;
}
+ static DeviceOrientation GetDeviceOrientation()
+ {
+ int width = 0;
+ int height = 0;
+ TSystemInfo.TryGetValue<int>("http://tizen.org/feature/screen.width", out width);
+ TSystemInfo.TryGetValue<int>("http://tizen.org/feature/screen.height", out height);
+
+ if (height >= width)
+ {
+ return DeviceOrientation.Portrait;
+ }
+ else
+ {
+ return DeviceOrientation.Landscape;
+ }
+ }
+
internal static void SendViewInitialized(this VisualElement self, EvasObject nativeView)
{
EventHandler<ViewInitializedEventArgs> viewInitialized = Forms.ViewInitialized;