Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bip901/avaloniadialogs
This library wraps DialogHost.Avalonia, providing a more convenient API and built-in common dialogs such as a Yes/No popup and a snackbar.
https://github.com/bip901/avaloniadialogs
avalonia dialogs
Last synced: 10 days ago
JSON representation
This library wraps DialogHost.Avalonia, providing a more convenient API and built-in common dialogs such as a Yes/No popup and a snackbar.
- Host: GitHub
- URL: https://github.com/bip901/avaloniadialogs
- Owner: Bip901
- License: mit
- Created: 2024-01-28T19:44:17.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-02-25T17:06:53.000Z (9 months ago)
- Last Synced: 2024-04-26T09:20:42.810Z (7 months ago)
- Topics: avalonia, dialogs
- Language: C#
- Homepage:
- Size: 35.2 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# AvaloniaDialogs
[![NuGet version](https://img.shields.io/nuget/v/AvaloniaDialogs.svg)](https://www.nuget.org/packages/AvaloniaDialogs/)
This library wraps [DialogHost.Avalonia](https://github.com/AvaloniaUtils/DialogHost.Avalonia/), providing a more convenient API and built-in common dialogs such as a Yes/No popup and a snackbar.
## [Quick Start Guide](./AvaloniaDialogs/README.md)
## Improvements over DialogHost.Avalonia
* Convenient async APIs - spawning a dialog is as easy as:
```csharp
SingleActionDialog dialog = new() {
Message = "Hello from C# code!",
ButtonText = "Click me!"
};
await dialog.ShowAsync();
```* Built-in common dialogs: Loading Dialog, Snackbar, Twofold (e.g. Yes/No), Threefold (e.g. Cancel/Discard/Save)
* Easy extensibility: to create your own dialogs, just inherit from `BaseDialog` (or `BaseDialog<>` if your dialog returns a result). For example, [here's a custom dialog](./AvaloniaDialogs.Demo/CustomDialog.axaml.cs) that displays a slider and returns the user's selection.
* Added support for nested dialogs - that is, opening a new dialog while another is showing on the same DialogHost.
* Improved keyboard UX - this library ensures correct keyboard focus to prevent interacting with elements below the dialog; Dialogs can be closed by pressing Escape by default; and more.