DoenaSoft.AbstractionLayer.UI
2.0.6
See the version list below for details.
dotnet add package DoenaSoft.AbstractionLayer.UI --version 2.0.6
NuGet\Install-Package DoenaSoft.AbstractionLayer.UI -Version 2.0.6
<PackageReference Include="DoenaSoft.AbstractionLayer.UI" Version="2.0.6" />
<PackageVersion Include="DoenaSoft.AbstractionLayer.UI" Version="2.0.6" />
<PackageReference Include="DoenaSoft.AbstractionLayer.UI" />
paket add DoenaSoft.AbstractionLayer.UI --version 2.0.6
#r "nuget: DoenaSoft.AbstractionLayer.UI, 2.0.6"
#:package DoenaSoft.AbstractionLayer.UI@2.0.6
#addin nuget:?package=DoenaSoft.AbstractionLayer.UI&version=2.0.6
#tool nuget:?package=DoenaSoft.AbstractionLayer.UI&version=2.0.6
DoenaSoft.AbstractionLayer.UI
Common UI abstractions used by the WinForms and WPF projects. This library provides small interface definitions that mirror important surface area of framework UI types so that application code can depend on interfaces instead of concrete types.
Package Id: DoenaSoft.AbstractionLayer.UI
Targets: netstandard2.0, net472, net10.0
Interfaces
The AbstractionLayer.UI project exposes the following interfaces in the Contracts folder. These are the actual interfaces implemented and used by the platform-specific adapters.
Main UI Services
IUIServices(namespaceDoenaSoft.AbstractionLayer.UIServices) - The primary UI service interface. Provides methods to show message boxes and common file/folder dialogs:ShowMessageBox- Display a message box with configurable text, caption, buttons, and iconShowOpenFileDialog- Show an open file dialog for single or multiple file selectionShowSaveFileDialog- Show a save file dialogShowFolderBrowserDialog- Show a folder browser dialog
Clipboard Operations
IClipboardServices(namespaceDoenaSoft.AbstractionLayer.UIServices) - Clipboard operations:ContainsText- Check if clipboard contains textGetText- Retrieve text from clipboardSetText- Set text to clipboardSetDataObject- Set data object to clipboard with retry logic and persistence options
Thread Synchronization
ISynchronizer(namespaceDoenaSoft.AbstractionLayer.UI.Contracts) - Invoke work on the UI thread:Invoke(Action)- Synchronously invoke an action on the UI threadInvoke<T>(Func<T>)- Synchronously invoke a function on the UI thread and return its resultBeginInvoke(Action)- Asynchronously invoke an action on the UI thread
IDispatcherOperation(namespaceDoenaSoft.AbstractionLayer.UI.Contracts) - Represents a posted dispatcher operation and exposes:Result- Gets the result after completionStatus- Gets the current status (Pending, Aborted, Completed, Executing)Task- Gets a Task that represents the operation
Supporting Data Types
Dialog Configuration
FileDialogOptions- Base configuration for file dialogs (filter, initial folder, title)OpenFileDialogOptions- Configuration for open file dialogs (extends FileDialogOptions, adds multi-select support)SaveFileDialogOptions- Configuration for save file dialogs (extends FileDialogOptions, adds overwrite prompt)FolderBrowserDialogOptions- Configuration for folder browser dialogs (description, selected path)
Enumerations
MessageButton- Message box button configuration (OK, YesNo, YesNoCancel)MessageIcon- Message box icon types (None, Information, Warning, Error, Question)Result- Dialog result values (OK, Cancel, Yes, No, etc.)DispatcherStatus- Dispatcher operation status (Pending, Aborted, Completed, Executing)
Usage
Program against these interfaces (for example IUIServices and ISynchronizer) and use the platform-specific adapter implementations in the WinForms or WPF projects. In unit tests provide fakes or mocks for these interfaces to avoid showing UI and to verify interactions.
Example
public class MyViewModel
{
private readonly DoenaSoft.AbstractionLayer.UIServices.IUIServices _uiServices;
public MyViewModel(DoenaSoft.AbstractionLayer.UIServices.IUIServices uiServices)
{
_uiServices = uiServices;
}
public void SaveFile(string content)
{
var options = new SaveFileDialogOptions
{
Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*",
Title = "Save File"
};
if (_uiServices.ShowSaveFileDialog(options, out string fileName))
{
// Save content to fileName
}
}
}
Reference this project from UI-specific packages (WinForms/WPF) or your application and program against the interfaces. Concrete adapter/extension types in the platform-specific projects map the real framework objects to these interfaces at runtime.
License: MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. 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 was computed. 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 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. |
| .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 | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. 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. |
-
.NETFramework 4.7.2
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
-
net10.0
- No dependencies.
NuGet packages (5)
Showing the top 5 NuGet packages that depend on DoenaSoft.AbstractionLayer.UI:
| Package | Downloads |
|---|---|
|
DoenaSoft.AbstractionLayer.WPF
WPF implementations of UI abstraction interfaces from DoenaSoft.AbstractionLayer.UI. Provides WindowUIServices (message boxes, dialogs), WindowClipboardServices (comprehensive clipboard operations including text, audio, images, file drop lists), and WindowSynchronizer for dispatcher invocation. |
|
|
DoenaSoft.AbstractionLayer.WinForms
Windows Forms implementations of UI abstraction interfaces from DoenaSoft.AbstractionLayer.UI. Provides FormUIServices (message boxes, dialogs), FormClipboardServices (comprehensive clipboard operations including text, audio, images, file drop lists), and FormSynchronizer for thread marshaling. |
|
|
DoenaSoft.AdaptBookFileNames
A .NET library for organizing and standardizing audiobook and e-book file names with consistent naming conventions. Supports MP3, M4A, MP4 audiobooks and EPUB, MOBI e-books with sequential numbering and chapter management. |
|
|
DoenaSoft.CalculateAudioBookRunningTimes
A library for extracting and calculating audiobook metadata including running times, chapters, authors, and narrators. Supports MP3 and MP4 audiobook formats with customizable interaction handling. |
|
|
DoenaSoft.PillRefresh
A .NET library for calculating medication supply duration and generating calendar reminders with automatic weekend and holiday avoidance. Supports multiple target frameworks and generates iCalendar (.ics) files compatible with Outlook, Google Calendar, and other applications. |
GitHub repositories
This package is not used by any popular GitHub repositories.