https://github.com/5cover/dialogs
A Windows task dialog wrapper that also supports navigation and hyperlinks.
https://github.com/5cover/dialogs
task-dialog taskdialog
Last synced: 12 months ago
JSON representation
A Windows task dialog wrapper that also supports navigation and hyperlinks.
- Host: GitHub
- URL: https://github.com/5cover/dialogs
- Owner: 5cover
- License: mit
- Created: 2022-12-11T21:06:34.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-04-12T10:04:18.000Z (about 2 years ago)
- Last Synced: 2025-05-19T13:03:20.707Z (about 1 year ago)
- Topics: task-dialog, taskdialog
- Language: C#
- Homepage:
- Size: 355 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dialogs
[](https://codeclimate.com/github/5cover/Dialogs/maintainability)
[](https://www.codefactor.io/repository/github/5cover/dialogs)
Managed Win32 [task dialog](https://learn.microsoft.com/en-us/windows/win32/controls/task-dialogs-overview) wrapper.
Supports all native Task Dialog features.
# Information
In order to use activation contexts, this package copies the [XPThemes.manifest](https://github.com/5cover/Dialogs/blob/master/Dialogs/XPThemes.manifest) file to the output directory.
# Usage
### Simple
Shows a simple task dialog.
```cs
using Scover.Dialogs;
using Page page = new()
{
Content = "Sample text",
Buttons = { Button.Yes, Button.No, Button.Cancel }
};
var clickedButton = new Dialog(page).Show();
```
### Multi-page
```cs
using Scover.Dialogs;
using Page page1 = new()
{
MainInstruction = "Page #1",
Buttons = new(ButtonStyle.CommandLinks)
{
{ "Label", "Supplemental instruction" },
Button.Cancel
}
};
using Page page2 = new()
{
MainInstruction = "Page #2",
Expander = new("Expanded information")
};
var clickedButton = new MultiPageDialog(page1, new Dictionary
{
[page1] = request => request.Kind is NavigationRequestKind.Cancel ? null : page2,
}).Show();
```
Check out [Tests.cs](https://github.com/5cover/Dialogs/blob/master/Tests/DialogTests.cs) for more examples.