Mobile/CafeLib.Mobile/Services/MobileService.cs
/// <summary>
/// Runs an action on a background worker thread.
/// </summary>
/// <param name="action">action</param>
/// <param name="cancellationToken"></param>
Runs an action on a background worker thread.
Runs an action on a background worker thread .
public void RunOnWorkerThread(Action action, CancellationToken cancellationToken = default)
        {
            if (IsOnMainThread())
            {
                Task.Run(action, cancellationToken);
            }
            else
            {
                action();
            }
        }
public void RunOnWorkerThread ( Action action , CancellationToken cancellationToken = default ) { if ( IsOnMainThread ( ) ) { Task . Run ( action , cancellationToken ) ; } else { action ( ) ; } }
Runs an action on a background worker thread.
Runs an action on a background worker thread .
action
Action
None
cancellationToken
CancellationToken
None