Xamarin.Forms by Microsoft

<PackageReference Include="Xamarin.Forms" Version="4.4.0.991210-pre2" />

.NET API 1,173,616 bytes

 Device

public static class Device
A utility class to interact with the current Device/Platform.
public static class Styles

public const string Android = "Android"

The string "Android", representing the Android operating system.

public const string GTK = "GTK"

The string "GTK", representing the Linux operating system.

public static DeviceInfo info

For internal use by the Xamarin.Forms platform.

public const string iOS = "iOS"

The string "iOS", representing the iOS operating system.

public const string macOS = "macOS"

The string "macOS", representing the macOS operating system.

public const string Tizen = "Tizen"

The string "Tizen", representing the Tizen operating system.

public const string UWP = "UWP"

The string "UWP", representing the UWP operating system.

public const string WPF = "WPF"

The string "WPF", representing the Windows Presentation Foundation framework.

public static IReadOnlyList<string> Flags { get; }

Gets a list of custom flags that were set on the device before Xamarin.Forms was initialized.

public static FlowDirection FlowDirection { get; }

Gets the flow direction on the device.

public static TargetIdiom Idiom { get; }

Gets the kind of device that Xamarin.Forms is currently working on.

public static DeviceInfo Info { get; set; }

For internal use by the Xamarin.Forms platform.

public static bool IsInvokeRequired { get; }

For internal use by the Xamarin.Forms platform.

public static TargetPlatform OS { get; }

Gets the TargetPlatform indicating the OS Xamarin.Forms is working on.

public static IPlatformServices PlatformServices { get; set; }

For internal use by the Xamarin.Forms platform.

public static string RuntimePlatform { get; }

Gets the kind of device that Xamarin.Forms is currently working on.

public static void BeginInvokeOnMainThread(Action action)

Invokes an Action on the device main (UI) thread.

public static Assembly[] GetAssemblies()

For internal use by the Xamarin.Forms platform.

public static double GetNamedSize(NamedSize size, Element targetElement)

Returns a double that represents a font size that corresponds to size on targetElement.

public static double GetNamedSize(NamedSize size, Type targetElementType)

Returns a double that represents the named size for the font that is used on the element on the native platform.

public static double GetNamedSize(NamedSize size, Type targetElementType, bool useOldSizes)

For internal use by the Xamarin.Forms platform.

public static Task<T> InvokeOnMainThreadAsync<T>(Func<T> func)

public static Task InvokeOnMainThreadAsync(Action action)

public static Task<T> InvokeOnMainThreadAsync<T>(Func<Task<T>> funcTask)

public static Task InvokeOnMainThreadAsync(Func<Task> funcTask)

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

Executes different Actions depending on the TargetPlatform that Xamarin.Forms is working on.

public static T OnPlatform<T>(T iOS, T Android, T WinPhone)

Returns different values depending on the TargetPlatform Xamarin.Forms is working on.

public static void OpenUri(Uri uri)

Request the device to open the Uri.

public static void SetFlags(IReadOnlyList<string> flags)

Sets a list of custom flags on the device.

public static void SetFlowDirection(FlowDirection value)

Sets the flow direction on the device.

public static void SetIdiom(TargetIdiom value)

For internal use by the Xamarin.Forms platform.

public static void SetTargetIdiom(TargetIdiom value)

For internal use by the Xamarin.Forms platform.

public static void StartTimer(TimeSpan interval, Func<bool> callback)

Starts a recurring timer on the UI thread using the device clock capabilities.