diff options
author | Kangho Hur <kangho.hur@samsung.com> | 2017-04-25 20:52:52 +0900 |
---|---|---|
committer | Kangho Hur <kangho.hur@samsung.com> | 2017-10-23 13:34:34 +0900 |
commit | b75a3c4944d2b8048e614e670f12872516396b0c (patch) | |
tree | 7591ef5b1ac005c50ec64d41e3987a63ba505833 /Xamarin.Forms.Platform.Tizen | |
parent | 95b099238002fa2c5915cf3725c605411980f560 (diff) | |
download | xamarin-forms-b75a3c4944d2b8048e614e670f12872516396b0c.tar.gz xamarin-forms-b75a3c4944d2b8048e614e670f12872516396b0c.tar.bz2 xamarin-forms-b75a3c4944d2b8048e614e670f12872516396b0c.zip |
Fix Device.Info creation issue
Change-Id: If9aa1d762364ef185593eb2bb38d1bbcd9d3ed6b
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen')
-rw-r--r-- | Xamarin.Forms.Platform.Tizen/Forms.cs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Forms.cs b/Xamarin.Forms.Platform.Tizen/Forms.cs index 555b149e..57fc6050 100644 --- a/Xamarin.Forms.Platform.Tizen/Forms.cs +++ b/Xamarin.Forms.Platform.Tizen/Forms.cs @@ -12,11 +12,16 @@ namespace Xamarin.Forms.Platform.Tizen { public static class Forms { + static Lazy<string> s_profile = new Lazy<string>(() => + { + //TODO : Fix me if elm_config_profile_get() unavailable + return Elementary.GetProfile(); + }); + static Lazy<int> s_dpi = new Lazy<int>(() => { int dpi = 0; - var info = Device.Info as TizenDeviceInfo; - if (info != null && info.Profile == "tv") + if (s_profile.Value == "tv") { // Use fixed DPI value (72) if TV profile return 72; @@ -75,9 +80,6 @@ namespace Xamarin.Forms.Platform.Tizen public TizenDeviceInfo(FormsApplication formsApplication) { - //TODO : Fix me if elm_config_profile_get() unavailable - profile = Elementary.GetProfile(); - int width = 0; int height = 0; @@ -92,6 +94,7 @@ namespace Xamarin.Forms.Platform.Tizen pixelScreenSize = new Size(width, height); scaledScreenSize = new Size(width / scalingFactor, height / scalingFactor); + profile = s_profile.Value; } } |