Bagikan melalui


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

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

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.

For internal use by the Microsoft.Maui.Controls platform.

RuntimePlatform
Obsolete.

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

Methods

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 a double that represents a font size that corresponds to size on targetElement.

GetNamedSize(NamedSize, Type, Boolean)
Obsolete.

For internal use by the Microsoft.Maui.Controls platform.

GetNamedSize(NamedSize, Type)
Obsolete.

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

InvokeOnMainThreadAsync(Action)
Obsolete.

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

InvokeOnMainThreadAsync(Func<Task>)
Obsolete.

Invokes a Func on the device main (UI) thread.

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

Invokes a Func on the device main (UI) thread.

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

Invokes a Func on the device main (UI) thread.

StartTimer(TimeSpan, Func<Boolean>)
Obsolete.

Starts a recurring timer using the device clock capabilities.

Applies to