GuiDispatcher.Sharp
1.1.0
See the version list below for details.
dotnet add package GuiDispatcher.Sharp --version 1.1.0
NuGet\Install-Package GuiDispatcher.Sharp -Version 1.1.0
<PackageReference Include="GuiDispatcher.Sharp" Version="1.1.0" />
<PackageVersion Include="GuiDispatcher.Sharp" Version="1.1.0" />
<PackageReference Include="GuiDispatcher.Sharp" />
paket add GuiDispatcher.Sharp --version 1.1.0
#r "nuget: GuiDispatcher.Sharp, 1.1.0"
#:package GuiDispatcher.Sharp@1.1.0
#addin nuget:?package=GuiDispatcher.Sharp&version=1.1.0
#tool nuget:?package=GuiDispatcher.Sharp&version=1.1.0
GuiDispatcher.Sharp
Platform-agnostic GUI dispatcher and timer abstractions for .NET 10.
Use this package from view models, services, debouncers, and other code that needs to marshal work back to a GUI/main thread without referencing a UI framework directly.
Install
<PackageReference Include="GuiDispatcher.Sharp" Version="1.1.*" />
Or via CLI:
dotnet add package GuiDispatcher.Sharp
Versioning follows Semantic Versioning. Releases are cut by pushing a vX.Y.Z git tag; see CHANGELOG.md for release history.
Requirements
- .NET 10 (
net10.0)
NuGet publishing
Publishing uses NuGet Trusted Publishing from GitHub Actions, not a stored API key.
Configure a trusted publishing policy on nuget.org:
| Field | Value |
|---|---|
| Repository owner | buchmiet |
| Repository | GuiDispatcher.Sharp |
| Workflow file | publish-nuget.yml |
| Environment | production |
Releasing
The Publish NuGet workflow only runs on vX.Y.Z tag pushes, and will fail unless the .csproj version and CHANGELOG.md are both updated first. To cut a release:
- Bump
<Version>inGuiDispatcher.Sharp.csproj. - Move the relevant
[Unreleased]entries inCHANGELOG.mdinto a new## [X.Y.Z] - YYYY-MM-DDsection. - Commit both changes.
- Tag and push:
git tag vX.Y.Z && git push origin vX.Y.Z— this triggers the publish workflow.
Contracts
Interfaces are in the GuiDispatcher.Sharp.Contracts namespace:
using GuiDispatcher.Sharp.Contracts;
public interface IGuiDispatcher
{
bool CheckAccess();
void Post(Action action);
void Invoke(Action action);
Task InvokeAsync(Action action);
Task InvokeAsync(Func<Task> action);
T Invoke<T>(Func<T> func);
IGuiTimer CreateTimer(TimeSpan interval);
IDisposable RunOnce(Action action, TimeSpan interval);
}
IGuiTimer exposes Tick, Interval, IsEnabled, Start, Stop, and Dispose.
Headless/default implementation
using GuiDispatcher.Sharp;
using GuiDispatcher.Sharp.Contracts;
IGuiDispatcher dispatcher = new ImmediateGuiDispatcher();
await dispatcher.InvokeAsync(() =>
{
viewModel.Apply(result);
});
ImmediateGuiDispatcher executes posted/invoked work inline. Its timers use System.Threading.Timer and marshal ticks through Post, which keeps tests and console hosts deterministic enough without a GUI framework dependency.
UI implementations
Install a platform adapter package for GUI applications:
<PackageReference Include="GuiDispatcher.Sharp.Avalonia" Version="1.1.*" />
WinUI 3 support is planned separately.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
NuGet packages (7)
Showing the top 5 NuGet packages that depend on GuiDispatcher.Sharp:
| Package | Downloads |
|---|---|
|
Debouncer.Sharp
Thread-safe debounce primitives for delayed, coalesced async work. |
|
|
GuiDispatcher.Sharp.Avalonia
Avalonia 12 implementation of GuiDispatcher.Sharp for .NET 10. |
|
|
GuiDispatcher.Sharp.Maui
.NET MAUI 10 implementation of GuiDispatcher.Sharp for .NET 10. |
|
|
GuiDispatcher.Sharp.Consolonia
Consolonia 11 implementation of GuiDispatcher.Sharp for .NET 10. |
|
|
GuiDispatcher.Sharp.WinUI
WinUI 3 implementation of GuiDispatcher.Sharp for .NET 10 and Windows App SDK 2. |
GitHub repositories
This package is not used by any popular GitHub repositories.