Net4x.Windows.ThreadsExtensions 1.0.0.1

dotnet add package Net4x.Windows.ThreadsExtensions --version 1.0.0.1
                    
NuGet\Install-Package Net4x.Windows.ThreadsExtensions -Version 1.0.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Net4x.Windows.ThreadsExtensions" Version="1.0.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Net4x.Windows.ThreadsExtensions" Version="1.0.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Net4x.Windows.ThreadsExtensions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Net4x.Windows.ThreadsExtensions --version 1.0.0.1
                    
#r "nuget: Net4x.Windows.ThreadsExtensions, 1.0.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Net4x.Windows.ThreadsExtensions@1.0.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Net4x.Windows.ThreadsExtensions&version=1.0.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Net4x.Windows.ThreadsExtensions&version=1.0.0.1
                    
Install as a Cake Tool

Net4x.Dispatcher

Net4x.Dispatcher provides dispatcher and UI-thread helpers designed to work across multiple .NET target frameworks. It offers a lightweight abstraction for marshaling work to a synchronization context or UI thread and includes timing helpers suitable for desktop UI scenarios.

Authors: Piero Viano

Purpose

This project offers compatibility utilities so libraries and applications can schedule and run work on UI/synchronization contexts consistently across older .NET Framework targets and newer .NET/.NET Core runtimes that target Windows UI thread scenarios.

Key features

  • Dispatcher-like API for posting and invoking actions on a synchronization/UI thread
  • DispatcherTimer helpers for periodic work on the UI thread
  • Integration points for WinForms/WPF test hosts and synchronization contexts
  • Cross-targeted to support both legacy .NET Framework and modern .NET TFMs where appropriate

Supported targets

Common TFMs produced by the project include:

  • netstandard2.0 (for broad compatibility)
  • net5.0-windows, net6.0-windows, net7.0-windows, net8.0-windows, net9.0-windows (where Windows-specific UI APIs are required)
  • net4x / .NET Framework variants used in the solution (see project file for exact TFMs)

Quick start

  • Add a reference to the Net4x.Dispatcher project or assembly appropriate for your target framework.
  • Use the dispatcher to post work to the UI/synchronization context instead of calling Control.Invoke / Dispatcher.Invoke directly so code can be cross-targeted.

Example (conceptual):

// Post an action to the dispatcher
var dispatcher = Net4x.Windows.Threads.Dispatcher.Current;
dispatcher.Post(() => {
    // UI-bound work
});

// Run synchronously on the dispatcher (if supported)
dispatcher.Invoke(() => {
    // Synchronous UI-bound work
});

Example using a timer helper:

var timer = new Net4x.Windows.Threads.DispatcherTimer(TimeSpan.FromSeconds(1));
timer.Tick += (s, e) => { /* periodic UI work */ };
timer.Start();

Note: APIs and types provided by the project are exposed by the Net4x.Windows.Threads assembly. Check the project source for exact type and member names for your targeted TFM.

Building

  • For SDK-style TFMs (netstandard / net5+): dotnet build in the Net4x.Windows.Threads project directory.
  • For .NET Framework builds: open the solution in Visual Studio and build the specific configuration.

Tests

Unit and integration tests that exercise dispatcher behavior are available under the tests/Dispatcher.Tests project. Run them with an appropriate test runner for the targeted framework (for SDK-style tests use dotnet test, for .NET Framework tests run them from Visual Studio).

Contributing

Please open issues or pull requests with reproducible test cases. When adding features or fixes:

  • Add or update unit tests in tests/Dispatcher.Tests.
  • Keep changes targeted and document any API additions or behavior changes.

License

See the repository LICENSE.txt for licensing details.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net6.0-windows7.0 is compatible.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net8.0-windows7.0 is compatible.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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-windows7.0 is compatible. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net40 is compatible.  net403 was computed.  net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0.1 33 1/10/2026
1.0.0 88 1/5/2026