Xamarin.Forms.Device.OnPlatform Method
Executes different Actions depending on the Xamarin.QcuikUI.TargetOS Forms is working on.

Syntax

public static void OnPlatform (Action iOS, Action Android, Action WinPhone, Action Default)

Parameters

iOS
(optional) The Action to execute on iOS.
Android
(optional) The Action to execute on Android.
WinPhone
(optional) The Action to execute on WinPhone.
Default
(optional) The Action to execute if no Action was provided for the current OS.

Remarks

This example show how to change the font of a Label on a single OS.

C# Example

Device.OnPlatform (iOS: () => label.Font = Font.OfSize ("HelveticaNeue-UltraLight", NamedSize.Large));
          

Requirements

Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions: 1.0.0.0, 1.1.0.0, 1.2.0.0, 1.3.0.0