OneCore.Net.WPF.MessageBoxes
1.0.3
dotnet add package OneCore.Net.WPF.MessageBoxes --version 1.0.3
NuGet\Install-Package OneCore.Net.WPF.MessageBoxes -Version 1.0.3
<PackageReference Include="OneCore.Net.WPF.MessageBoxes" Version="1.0.3" />
<PackageVersion Include="OneCore.Net.WPF.MessageBoxes" Version="1.0.3" />
<PackageReference Include="OneCore.Net.WPF.MessageBoxes" />
paket add OneCore.Net.WPF.MessageBoxes --version 1.0.3
#r "nuget: OneCore.Net.WPF.MessageBoxes, 1.0.3"
#:package OneCore.Net.WPF.MessageBoxes@1.0.3
#addin nuget:?package=OneCore.Net.WPF.MessageBoxes&version=1.0.3
#tool nuget:?package=OneCore.Net.WPF.MessageBoxes&version=1.0.3
![]()
OneCore.Net.WPF.MessageBoxes Library
Overview
OneCore.Net.WPF.MessageBoxes is a library that offers an extended, highly customizable message box with a styled WPF window for enhanced user interaction.
Preview
(Some button labels are n German because the screenshots are made on a German windows)
- Example 1

- Example 2

- Example 3

- Example 4

- Example 5

- Example 6

Features
- Styling: Build in Light and Dark style and allow passing custom styles.
- Window Settings: Settings like show in task bar, minimum and maximum sizes, resize modes and more.
- Additional Buttons: Buttons like Yes To All, Try Again and some more.
- Do not show again checkbox: Checkbox shown on the bottom left for configure a do not show again.
- Details: Allow expanding and collapsing an area to display details.
- Clipboard: Like the original, pressing CTRL+C copies all shown in the message box to the clipboard. That contains the optional details section.
- Localization: All buttons shown can be localized manually. Those who are available by windows are also auto translated if needed.
Getting Started
Installation:
- Install the OneCore.Net.WPF.MessageBoxes library via NuGet Package Manager:
dotnet add package OneCore.Net.WPF.MessageBoxesUsage:
- Simply use the OneCore.WPF.MessageBox like you would use the build in.
var result = MessageBox.Show(ownerWindow, "Message", "Caption", MessageBoxButtons.YesNo); if (result == MessageBoxResult.Yes) { }Styling:
- With build in dark style
var options = new MessageBoxOptions(); options.WindowOptions.Theme = WindowTheme.Dark; // The window title bar options.Styles.Theme = WindowTheme.Dark; // The controls MessageBox.Show(this, "Message", "Caption", options);- With custom styles
var options = new MessageBoxOptions(); options.WindowOptions.Theme = WindowTheme.Dark; // The window title bar options.Styles.ButtonStyle = myButtonStyle; MessageBox.Show(this, "Message", "Caption", options);Localization:
- Translate yes and no buttons
var options = new MessageBoxOptions(); options.Strings.Yes = "Yay"; options.Strings.No = "Nay"; MessageBox.Show(this, "Message", "Caption", options);Details:
- Show call stack in details pane
var options = new MessageBoxOptions(); options.ShowDetails = true; options.DetailsText = Environment.StackTrace; MessageBox.Show(this, "See Details", "Error", options);Do not show again:
- Add the checkbox and save it accordingly
var options = new MessageBoxOptions(); options.ShowDoNotShowAgainCheckBox = true; var result = MessageBox.Show(this, "You want to close the application?", "Close", options); system.DoNotShowAgain = options.IsDoNotShowAgainChecked;
Example
Save single or all
public class MainViewModel { public void SaveAll() { var options = new MessageBoxOptions(); options.ShowYesToAllButton = true; var result = MessageBox.Show(this, "Save changed files?", "Save", MessageBoxButtons.YesNo, options); switch (result) { case MessageBoxResult.Yes: SaveCurrentFile(); break; case MessageBoxResult.YesToAll: SaveAllFiles(); break; case MessageBoxResult.No: break; } } }Do not show again
public class MainViewModel { public void TryShutdown() { if (!Settings.DoNotShowAgain) { var options = new MessageBoxOptions(); options.ShowDoNotShowAgainCheckBox = true; var result = MessageBox.Show(this, "You want to close the application?", "Close", options); Settings.DoNotShowAgain = options.IsDoNotShowAgainChecked; if (result == MessageBoxResult.Yes) Shutdown(); } else Shutdown(); } }
Links
License
Copyright (c) David Wendland. All rights reserved. Licensed under the MIT License. See LICENSE file in the project root for full license information.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0-windows7.0 is compatible. net9.0-windows was computed. net10.0-windows was computed. |
-
net8.0-windows7.0
- OneCore.Net.WPF.Theming (>= 1.0.1)
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 |
|---|