summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core/Device.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Core/Device.cs')
-rw-r--r--Xamarin.Forms.Core/Device.cs27
1 files changed, 27 insertions, 0 deletions
diff --git a/Xamarin.Forms.Core/Device.cs b/Xamarin.Forms.Core/Device.cs
index db0a2747..50fdcfc0 100644
--- a/Xamarin.Forms.Core/Device.cs
+++ b/Xamarin.Forms.Core/Device.cs
@@ -88,6 +88,21 @@ namespace Xamarin.Forms
}
}
+ public static void OnPlatform(Action iOS = null, Action Android = null, Action WinPhone = null, Action Default = null, Action Tizen = null)
+ {
+ if (OS == TargetPlatform.Tizen)
+ {
+ if (Tizen != null)
+ Tizen();
+ else if (Default != null)
+ Default();
+ }
+ else
+ {
+ OnPlatform(iOS, Android, WinPhone, Default);
+ }
+ }
+
public static T OnPlatform<T>(T iOS, T Android, T WinPhone)
{
switch (OS)
@@ -104,6 +119,18 @@ namespace Xamarin.Forms
return iOS;
}
+ public static T OnPlatform<T>(T iOS, T Android, T WinPhone, T Tizen)
+ {
+ if (OS == TargetPlatform.Tizen)
+ {
+ return Tizen;
+ }
+ else
+ {
+ return OnPlatform<T>(iOS, Android, WinPhone);
+ }
+ }
+
public static void OpenUri(Uri uri)
{
PlatformServices.OpenUriAction(uri);