BlackSharp.MVVM
1.2.2
Prefix Reserved
dotnet add package BlackSharp.MVVM --version 1.2.2
NuGet\Install-Package BlackSharp.MVVM -Version 1.2.2
<PackageReference Include="BlackSharp.MVVM" Version="1.2.2" />
<PackageVersion Include="BlackSharp.MVVM" Version="1.2.2" />
<PackageReference Include="BlackSharp.MVVM" />
paket add BlackSharp.MVVM --version 1.2.2
#r "nuget: BlackSharp.MVVM, 1.2.2"
#:package BlackSharp.MVVM@1.2.2
#addin nuget:?package=BlackSharp.MVVM&version=1.2.2
#tool nuget:?package=BlackSharp.MVVM&version=1.2.2
<h1 align="center">BlackSharp</h1>
Reusable .NET building blocks for application logic, device communication and desktop interfaces.
BlackSharp brings commonly needed functionality into a set of focused libraries: core utilities, USB HID communication, native serial and raw USB access, MVVM helpers and Avalonia controls. Share proven building blocks across applications without copying infrastructure code into every project.
The libraries are general-purpose components.
Key capabilities
- Everyday utilities for collections, strings, files, byte and bit operations, unit conversions, reflection, logging, asynchronous work & more
- USB HID communication with device discovery, report metadata and cancellable worker-based I/O on Windows and Linux
- Native serial and raw USB access with configurable timeouts, flow control, device discovery and platform-specific transports
- MVVM foundations built on CommunityToolkit.Mvvm, including view-model bases, drag-and-drop contracts and shared dialog models
- Avalonia desktop components including dialogs, numeric text boxes, busy indicators, reorderable controls, behaviors, converters and shared styles
- Modular dependencies so utility and device-access consumers do not need to bring in a desktop UI framework
Choosing a package
Install the required packages through your IDE's NuGet package manager.
Start with BlackSharp.Core for shared application utilities.
Add BlackSharp.IO.HID for HID devices or BlackSharp.IO.Ports for serial and raw
USB communication.
Use BlackSharp.MVVM for view-model infrastructure and
BlackSharp.UI.Avalonia for the Avalonia integration.
Projects
| Project | NuGet package | Downloads | Purpose |
|---|---|---|---|
BlackSharp.Core |
General-purpose utilities, conversions, collections, logging and native interop helpers | ||
BlackSharp.IO.HID |
USB HID discovery, report handling and device streams | ||
BlackSharp.IO.Ports |
Native serial communication and raw USB device access | ||
BlackSharp.MVVM |
View-model bases and shared MVVM contracts | ||
BlackSharp.UI.Avalonia |
Avalonia controls, dialogs, behaviors, styles and desktop integration |
Supported .NET versions
| Target | Core, IO.HID and IO.Ports | MVVM and UI.Avalonia |
|---|---|---|
| .NET Framework 4.7.2 | ✅ | ❌ |
| .NET Framework 4.8.1 | ✅ | ❌ |
| .NET Standard 2.0 | ✅ | ❌ |
| .NET 8 | ✅ | ✅ |
| .NET 9 | ✅ | ✅ |
| .NET 10 | ✅ | ✅ |
Quick start
Core utilities
Reference BlackSharp.Core to use shared helpers without any UI or
device-transport dependencies:
using System;
using BlackSharp.Core.Converters;
using BlackSharp.Core.Converters.Enums;
var mebibytes = DataUnitConverter.Convert(1048576m, DataUnit.Byte, DataUnit.MebiByte);
Console.WriteLine($"{mebibytes} MiB");
HID discovery
Reference BlackSharp.IO.HID to enumerate HID interfaces on Windows or Linux:
using System;
using BlackSharp.IO.HID;
foreach (var device in HIDDeviceEnumerator.GetDevices())
{
Console.WriteLine($"{device.VendorID:X4}:{device.ProductID:X4} {device.ProductName}");
}
Open a selected interface through HIDDevice.Open() or TryOpen() when your
application is ready to communicate and dispose the returned stream when
finished. Device-specific report formats still need to be implemented by the
consumer.
Versioning
Versions/BLACKSHARP.VERSION is the single
authoritative version for the five NuGet packages and the projects that produce
them. Change only this file to prepare the next version; individual project
files do not carry separate release numbers.
Use packages from the same BlackSharp release together.
Troubleshooting and support
For device-access failures, check permissions, the installed device driver, native dependencies and whether another application is using the device. For UI issues, distinguish a reusable BlackSharp component from the Avalonia backend and application-specific resource configuration.
When opening a GitHub issue, include the affected package and version, target framework, operating system, architecture, a minimal reproduction and the complete exception. For device issues, include relevant device identifiers and transport settings; remove serial numbers, credentials and other sensitive data before posting.
Contributing
Everyone is welcome and encouraged to contribute. Bug reports, documentation, tests, fixes and additional reusable components are all valuable. Keep changes focused and follow the existing architecture, naming, documentation, formatting and code style. Include or update tests and documentation where applicable, and describe the affected packages, platforms and validation in the pull request.
AI-assisted contributions
Transparency about the use of artificial intelligence is required. Changes created entirely by AI must be clearly marked as AI-generated in the pull request description. Changes to which an AI tool contributed must likewise be marked as AI-assisted, even when they were subsequently reviewed or edited by the contributor. The disclosure should identify the affected parts of the change. Contributors remain responsible for understanding, reviewing and testing their submissions, as well as for their correctness, security and license compliance.
AI tools have supported the development of this project, including documentation and unit testing.
License
Licensed under the Mozilla Public License 2.0.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. net9.0 is compatible. 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
- BlackSharp.Core (>= 1.2.2)
- CommunityToolkit.Mvvm (>= 8.4.2)
-
net8.0
- BlackSharp.Core (>= 1.2.2)
- CommunityToolkit.Mvvm (>= 8.4.2)
-
net9.0
- BlackSharp.Core (>= 1.2.2)
- CommunityToolkit.Mvvm (>= 8.4.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on BlackSharp.MVVM:
| Package | Downloads |
|---|---|
|
BlackSharp.UI.Avalonia
A framework to eliminate duplicate code across projects. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.2.2 | 117 | 9/23/2026 |
| 1.2.1 | 115 | 9/14/2026 |
| 1.2.0 | 175 | 8/21/2026 |
| 1.1.4 | 149 | 7/23/2026 |
| 1.1.3 | 175 | 7/19/2026 |
| 1.1.2 | 152 | 6/14/2026 |
| 1.1.1 | 162 | 5/22/2026 |
| 1.1.0 | 182 | 5/9/2026 |
| 1.0.14 | 163 | 5/8/2026 |
| 1.0.13 | 161 | 4/11/2026 |
| 1.0.12 | 374 | 3/4/2026 |
| 1.0.11 | 172 | 2/28/2026 |
| 1.0.10 | 152 | 2/26/2026 |
| 1.0.9 | 181 | 2/14/2026 |
| 1.0.8 | 153 | 2/14/2026 |
| 1.0.7 | 297 | 1/5/2026 |
| 1.0.6 | 397 | 12/16/2025 |
| 1.0.5 | 218 | 11/29/2025 |
| 1.0.4 | 226 | 11/28/2025 |
| 1.0.3 | 394 | 11/12/2025 |