Share via


Device Class

Definition

Caution

This API is now deprecated.

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

public ref class Device abstract sealed
[System.Obsolete]
public static class Device
[<System.Obsolete>]
type Device = class
Public Class Device
Inheritance
Device
Attributes

Fields

Name Description
Android
Obsolete.

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

iOS
Obsolete.

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

MacCatalyst
Tizen
Obsolete.

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

tvOS
UWP
Obsolete.

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

WinUI

Properties

Name Description
DefaultRendererAssembly
FlowDirection
Obsolete.

Gets the flow direction on the device.

Idiom
Obsolete.

Gets the kind of device that Microsoft.Maui.Controls is currently working on.

IsInvokeRequired
Obsolete.

Internal API for Microsoft.Maui.Controls platform use.

RuntimePlatform
Obsolete.

Gets the kind of device that Microsoft.Maui.Controls is currently working on.

Methods

Name Description
BeginInvokeOnMainThread(Action)
Obsolete.

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

GetMainThreadSynchronizationContextAsync()
Obsolete.

Returns the current SynchronizationContext from the main thread.

GetNamedSize(NamedSize, Element)
Obsolete.

Returns the named font size for the specified element type.

GetNamedSize(NamedSize, Type, Boolean)
Obsolete.

Returns the named font size for the specified element type.

GetNamedSize(NamedSize, Type)
Obsolete.

Returns the named font size for the specified element type.

InvokeOnMainThreadAsync(Action)
Obsolete.

Invokes an action on the main thread asynchronously.

InvokeOnMainThreadAsync(Func<Task>)
Obsolete.

Invokes an async task-returning function on the main thread.

InvokeOnMainThreadAsync<T>(Func<T>)
Obsolete.

Invokes an async function on the main thread and returns the result.

InvokeOnMainThreadAsync<T>(Func<Task<T>>)
Obsolete.

Invokes an async task-returning function on the main thread and returns the result.

StartTimer(TimeSpan, Func<Boolean>)
Obsolete.

Starts a recurring timer using the device clock capabilities.

Applies to