Device Device Class

Definition

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

public static class Device
type Device = class
Inheritance
DeviceDevice

Fields

Android Android

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

GTK GTK

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

info info

For internal use by the Xamarin.Forms platform.

iOS iOS

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

macOS macOS

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

Tizen Tizen

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

UWP UWP

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

WPF WPF

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

Properties

Flags Flags

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

FlowDirection FlowDirection

Gets the flow direction on the device.

Idiom Idiom

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

Info Info

For internal use by the Xamarin.Forms platform.

IsInvokeRequired IsInvokeRequired

For internal use by the Xamarin.Forms platform.

OS OS

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

PlatformServices PlatformServices

For internal use by the Xamarin.Forms platform.

RuntimePlatform RuntimePlatform

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

Methods

BeginInvokeOnMainThread(Action) BeginInvokeOnMainThread(Action)

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

GetAssemblies() GetAssemblies()

For internal use by the Xamarin.Forms platform.

GetNamedSize(NamedSize, Type) GetNamedSize(NamedSize, Type)

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

GetNamedSize(NamedSize, Element) GetNamedSize(NamedSize, Element)

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

GetNamedSize(NamedSize, Type, Boolean) GetNamedSize(NamedSize, Type, Boolean)

For internal use by the Xamarin.Forms platform.

OnPlatform(Action, Action, Action, Action) OnPlatform(Action, Action, Action, Action)

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

OnPlatform<T>(T, T, T) OnPlatform<T>(T, T, T)

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

OpenUri(Uri) OpenUri(Uri)

Request the device to open the Uri.

SetFlags(IReadOnlyList<String>) SetFlags(IReadOnlyList<String>)

Sets a list of custom flags on the device.

SetFlowDirection(FlowDirection) SetFlowDirection(FlowDirection)

Sets the flow direction on the device.

SetIdiom(TargetIdiom) SetIdiom(TargetIdiom)

For internal use by the Xamarin.Forms platform.

SetTargetIdiom(TargetIdiom) SetTargetIdiom(TargetIdiom)

For internal use by the Xamarin.Forms platform.

StartTimer(TimeSpan, Func<Boolean>) StartTimer(TimeSpan, Func<Boolean>)

Starts a recurring timer using the device clock capabilities.

Extension Methods

LoadFromXaml<TXaml>(TXaml, String) LoadFromXaml<TXaml>(TXaml, String)

Returns an initialized view by loading the specified xaml.

LoadFromXaml<TXaml>(TXaml, Type) LoadFromXaml<TXaml>(TXaml, Type)

Returns a TXaml with the properties that are defined in the application manifest for callingType.

Applies to