Threading and UI
The core works on IO threads and the thread pool. It does not assume WinForms, WPF, or any specific UI framework.
DataReceivedandStateChangedmay fire on non-UI threads.- Switch to the UI thread before updating controls.
- Prefer Zeus presentation adapters instead of writing
InvokeorDispatcher.Invokein every window. - Avoid long blocking work inside event callbacks.
| Assembly | Thread handoff | Common APIs |
|---|---|---|
Zeus.Presentation.WinForms | Control.BeginInvoke | AttachZeus, BindTo, BindEnabled |
Zeus.Presentation.Wpf | Dispatcher.BeginInvoke | AttachZeus, BindTo, BindEnabled, AsBindingSource |
Zeus.Presentation.Abstractions | IUiDispatcher | ImmediateUiDispatcher for tests |
The core packages and Zeus.Presentation.Abstractions do not reference desktop frameworks.
If you must subscribe manually, use BeginInvoke in WinForms and the WPF Dispatcher in WPF. Do not update controls after their window has closed.