Table of Contents

Class Super

Namespace
DrawnUi.Draw
Assembly
DrawnUi.Maui.dll
public class Super
Inheritance
Super
Inherited Members
Extension Methods

Fields

CanUseHardwareAcceleration

Can optionally disable hardware-acceleration with this flag, for example on iOS you would want to avoid creating many metal views.

public static bool CanUseHardwareAcceleration

Field Value

bool

CapMicroSecs

Capping FPS,at 120

public static float CapMicroSecs

Field Value

float

CreateHttpClient

Since we removed IHttpClientFactory for faster app startup on mobile one can set this delegate to be used to create a custom client that would be used for loading internet sources.

public static Func<IServiceProvider, HttpClient> CreateHttpClient

Field Value

Func<IServiceProvider, HttpClient>

InitialWindowSize

public static Size InitialWindowSize

Field Value

Size

InsetsChanged

Subscribe your navigation bar to react

public static EventHandler InsetsChanged

Field Value

EventHandler

IsPrerenderingEnabled

When using accelerated rendering, enables CPU pre-rendering to show content immediately while GPU initializes. Set to false to skip software pre-render (saves memory but may show blank frame during GPU init). Default is true.

public static bool IsPrerenderingEnabled

Field Value

bool

Multithreaded

Experimental for dev use. Set OffscreenRenderingAtCanvasLevel to true when this is true. Default is False

public static bool Multithreaded

Field Value

bool

OnMauiAppCreated

Maui App was launched and UI is ready to be consumed

public static Action OnMauiAppCreated

Field Value

Action

PreloadRegisteredFonts

public static bool PreloadRegisteredFonts

Field Value

bool

SendTapsOnMainThread

Used by Tapped event handler, default is false

public static bool SendTapsOnMainThread

Field Value

bool

SkiaGeneration

public static int SkiaGeneration

Field Value

int

UseFrozenVisualLayers

public static bool UseFrozenVisualLayers

Field Value

bool

Properties

App

public static IApplication App { get; set; }

Property Value

IApplication

AppContext

public static IMauiContext AppContext { get; }

Property Value

IMauiContext

BottomTabsHeight

In DP

public static double BottomTabsHeight { get; set; }

Property Value

double

CacheEnabled

public static bool CacheEnabled { get; set; }

Property Value

bool

ColorAccent

public static Color ColorAccent { get; set; }

Property Value

Color

ColorPrimary

public static Color ColorPrimary { get; set; }

Property Value

Color

DeviceOrientation

public static DeviceOrientation DeviceOrientation { get; set; }

Property Value

DeviceOrientation

DeviceRotation

Degrees

public static int DeviceRotation { get; set; }

Property Value

int

DeviceRotationSnap

public static int DeviceRotationSnap { get; }

Property Value

int

EnableRendering

public static bool EnableRendering { get; set; }

Property Value

bool

FontSubPixelRendering

Enables sub-pixel font rendering, might provide better antialiasing on some platforms. Default is True;

public static bool FontSubPixelRendering { get; set; }

Property Value

bool

GpuCacheEnabled

public static bool GpuCacheEnabled { get; set; }

Property Value

bool

InBackground

public static bool InBackground { get; protected set; }

Property Value

bool

Initialized

public static bool Initialized { get; set; }

Property Value

bool

IsRtl

RTL support UNDER CONSTRUCTION

public static bool IsRtl { get; set; }

Property Value

bool

MaxFps

Limits the rendering loop to this frame rate. 0 means unlimited (uses display refresh rate). on iOS this will work only in steps 60, 30, 20, 15, 12... if you set 35 ios would run at run 60. On Android you might want to set a bit higher like 35 to get around 30to and avoid never reaching 30. Can be changed at runtime on all platforms.

public static int MaxFps { get; set; }

Property Value

int

MaxFrameLengthMs

public static double MaxFrameLengthMs { get; set; }

Property Value

double

NavBarHeight

In DP

public static double NavBarHeight { get; set; }

Property Value

double

NavigationBarHeight

In DP, actually Android only

public static double NavigationBarHeight { get; set; }

Property Value

double

OffscreenRenderingAtCanvasLevel

If set to True will process all ofscreen rendering in one background thread at canvas level, otherwise every control will launch its own background processing thread. Default is False

public static bool OffscreenRenderingAtCanvasLevel { get; set; }

Property Value

bool

Screen

public static Screen Screen { get; }

Property Value

Screen

Services

public static IServiceProvider Services { get; }

Property Value

IServiceProvider

StatusBarHeight

In DP

public static double StatusBarHeight { get; set; }

Property Value

double

StopRenderingInBackground

public static bool StopRenderingInBackground { get; set; }

Property Value

bool

UserAgent

public static string UserAgent { get; set; }

Property Value

string

Methods

DisplayException(VisualElement, Exception)

Display xaml page creation exception

public static void DisplayException(VisualElement view, Exception e)

Parameters

view VisualElement
e Exception

EnqueueBackgroundTask(Func<Task>)

public static void EnqueueBackgroundTask(Func<Task> asyncAction)

Parameters

asyncAction Func<Task>

GetCurrentTimeMs()

public static long GetCurrentTimeMs()

Returns

long

GetCurrentTimeNanos()

public static long GetCurrentTimeNanos()

Returns

long

InitShared()

protected static void InitShared()

Log(LogLevel, string, string)

Logs a message at the specified level.

public static void Log(LogLevel level, string message, string caller = null)

Parameters

level LogLevel
message string
caller string

Log(Exception, string)

Logs an exception at Error level. If a startup logger is configured, delegates to it; otherwise falls back to Trace/Console.

public static void Log(Exception e, string caller = null)

Parameters

e Exception

The exception to log.

caller string

The calling member name (optional).

Log(string, LogLevel, string)

Logs a message. By convention, string-only calls are Warning level.

public static void Log(string message, LogLevel logLevel = LogLevel.Warning, string caller = null)

Parameters

message string
logLevel LogLevel
caller string

NeedGlobalUpdate()

This will force recalculate canvas visibility in ViewTree and update those visible. Also when GRContext changes, all references must be cleared to avoid crash on next draw

public static void NeedGlobalUpdate()

OnCreated()

public static void OnCreated()

OnWentBackground()

public static void OnWentBackground()

OnWentForeground()

public static void OnWentForeground()

ProcessBackgroundQueue()

protected static Task ProcessBackgroundQueue()

Returns

Task

ResizeWindow(Window, int, int, bool)

For desktop platforms, will resize app window and eventually lock it from being resized.

public static void ResizeWindow(Window window, int width, int height, bool isFixed)

Parameters

window Window
width int
height int
isFixed bool

RunOnMainThreadAndWait(Action, CancellationToken)

public static void RunOnMainThreadAndWait(Action action, CancellationToken cancellationToken = default)

Parameters

action Action
cancellationToken CancellationToken

RunOnMainThreadAndWaitAsync(Func<Task>, CancellationToken)

public static Task RunOnMainThreadAndWaitAsync(Func<Task> asyncAction, CancellationToken cancellationToken = default)

Parameters

asyncAction Func<Task>
cancellationToken CancellationToken

Returns

Task

SetLocale(string)

public static void SetLocale(string lang)

Parameters

lang string

SetupFrameLooper()

protected static void SetupFrameLooper()

Events

HotReload

Will be triggered only if debugger is attached

public static event Action<Type[]?>? HotReload

Event Type

Action<Type[]>

NeedGlobalRefresh

This will force recalculate canvas visibility in ViewTree and update those visible. Also when GRContext changes, all references must be cleared to avoid crash on next draw

public static event EventHandler NeedGlobalRefresh

Event Type

EventHandler

OnNativeAppCreated

App was launched and UI is ready to be created

public static event EventHandler OnNativeAppCreated

Event Type

EventHandler

OnNativeAppDestroyed

public static event EventHandler OnNativeAppDestroyed

Event Type

EventHandler

OnNativeAppPaused

public static event EventHandler OnNativeAppPaused

Event Type

EventHandler

OnNativeAppResumed

public static event EventHandler OnNativeAppResumed

Event Type

EventHandler

OrientationChanged

public static event EventHandler<DeviceOrientation> OrientationChanged

Event Type

EventHandler<DeviceOrientation>

RotationChanged

public static event EventHandler<int> RotationChanged

Event Type

EventHandler<int>