Header menu logo Fittings

SyncWpf Type

Threading Utils to setup and access the SynchronizationContext and evaluate any function on UI thread (Sync.doSync(f))

Static members

Static member Description

SyncWpf.context

Full Usage: SyncWpf.context

Returns: SynchronizationContext

The UI SynchronizationContext to switch to inside async workflows Accessing this member from any thread will set up the sync context first if it is not there yet. If installSynchronizationContext fails an error file is written on the desktop since debugging this kind of errors can be hard

Returns: SynchronizationContext

SyncWpf.doSync func

Full Usage: SyncWpf.doSync func

Parameters:
    func : unit -> unit

Runs function on UI thread This Ui thread will also be a STAThread If installSynchronizationContext fails an error file is written on the desktop since debugging this kind of errors can be hard

func : unit -> unit

SyncWpf.installSynchronizationContext logErrorsOnDesktop

Full Usage: SyncWpf.installSynchronizationContext logErrorsOnDesktop

Parameters:
    logErrorsOnDesktop : bool

To ensure SynchronizationContext is set up. Optionally writes a log file to the desktop if it fails, since these errors can be really hard to debug

logErrorsOnDesktop : bool

Type something to start searching.