Table of Contents

Method TrySetFocusWithTimeout

Namespace
Alternet.UI
Assembly
Alternet.UI.Maui.dll

TrySetFocusWithTimeout(int)

Attempts to set focus to the view within the specified timeout.

public virtual Task TrySetFocusWithTimeout(int timeout = 2000)

Parameters

timeout int

The maximum time (in milliseconds) to attempt setting focus. Default is 2000ms.

Returns

Task

Remarks

This method continuously checks if the view is focused and tries to set focus if it isn't. It runs in a background task and stops once focus is achieved or the timeout expires.