MessageWindowWPF 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package MessageWindowWPF --version 1.1.0
                    
NuGet\Install-Package MessageWindowWPF -Version 1.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MessageWindowWPF" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MessageWindowWPF" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="MessageWindowWPF" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MessageWindowWPF --version 1.1.0
                    
#r "nuget: MessageWindowWPF, 1.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MessageWindowWPF@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MessageWindowWPF&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=MessageWindowWPF&version=1.1.0
                    
Install as a Cake Tool

MessageWindowWPF

Includes MessageBox with a more modern interface and rich text support, InputBox, can auto-closing Prompt Window. Support to switch dark or light theme.
包括支持富文本的更现代化界面的消息框、输入框、可自动关闭的提示窗。支持设置浅色/深色主题。

MessageBox:
MessageBox

InputBox:
InputBox

Prompt:
Prompt

DarkTheme:
DarkMessageBox

release nuget license C#

Description 说明

English Description

Download package from Nuget, or using the release Dll.

MessageBox

MessageBox

Except for the absence of the MessageBoxOptions parameter, all other features are seamlessly integrated with the original version.

using MessageBox = MessageWindowWPF.MessageBox; //Just add the namespace

  MessageBox.Show("Message!");
  MessageBox.Show("Message2!", "Tip", MessageBoxButton.OK, MessageBoxImage.Information);

MessageBox-richtext
If you want to display rich text, you can also just pass in the parameters:

using MessageBox = MessageWindowWPF.MessageBox; 

  List<Inline> inlines = new List<Inline>();
  inlines.Add(new Run("normal text. "));
  inlines.Add(new Run("red text.") { Foreground = Brushes.Red });
  MessageBox.Show(inlines, "Tip", MessageBoxButton.OK, MessageBoxImage.Information);

Some configurations can also be customized:

using MessageWindowWPF;
using MessageBox = MessageWindowWPF.MessageBox;

  MessageSetting.NoSystemHeader = MessageSetting.settings.WithCornerRadius = true; //Without system title bar, and change to rounded corners
  MessageSetting.UseDarkTheme = true;//set dark or light theme. Default is light theme.
  //MessageSetting.CustomColor = new MessageSetting.CustomColorData() { WindowText = Colors.Red };//even control text, background and other color
  MessageBox.Show("Message!", "Tip", MessageBoxButton.OK, MessageBoxImage.Information);

InputBox

InputBox

Input box similar to VB's component.

using MessageWindowWPF;

  InputBox inputBox = new InputBox();
  if (inputBox.ShowDialog("Write Something:", "Title") == true)
    Console.WriteLine(inputBox.value);

Function: inputBox.ShowDialog(string message = null, string title = null, string defaultValue = null), return bool?.

Some configurations can also be customized:

using MessageWindowWPF;

  MessageSetting.NoSystemHeader = MessageSetting.settings.WithCornerRadius = true;
  MessageSetting.UseDarkTheme = true;
  //MessageSetting.CustomColor = new MessageSetting.CustomColorData() { WindowText = Colors.Red };
  InputBox inputBox = new InputBox();
  if (inputBox.ShowDialog("Write Something:", "Title") == true)
    Console.WriteLine(inputBox.value);

Prompt

Prompt

Fade-in and fade-out cues, support countdown and double click to close.

using MessageWindowWPF;

  Prompt.Show("Show text");

Function: Prompt.Show(string content, double liveSeconds = 3, Window owner = null, Point? point = null, Color? backColor = null), return Window.
When the parameter value of "liveSeconds" ⇐ 0, the window will be displayed until it is closed by double-clicking.

Prompt-richtext
If you want to display rich text, you can also just pass in the parameters:

using MessageWindowWPF;

  List<Inline> inlines = new List<Inline>();
  inlines.Add(new Run("normal text. "));
  inlines.Add(new Run("red text.") { Foreground = Brushes.Red });
  Prompt.Show(inlines);

Custom configurations only have an effect on the color, but the color parameter of the function has a higher priority:

using MessageWindowWPF;
  MessageSetting.UseDarkTheme = true;
  MessageSetting.CustomColor = new MessageSetting.CustomColorData() { WindowText = Colors.Red };
  Prompt.Show("Show text");

Additional information

  • Because there are only four buttons, the current text only comes with Chinese and English. The default is displayed in the current language. Alternatively, you can set it manually by changing the value of "MessageSetting.settings.UIculture".

Version

  • V1.1.0 2022/11/06 added support for light and dark themes, simplified settings, and allowed for full customization of colors.
  • v1.0.0 2022/12/07 Basic features.

中文说明

从Nuget下载包,或者引用release的Dll。

消息窗(MessageBox)

MessageBox
除了没有 MessageBoxOptions 参数之外,其他功能都与原版无缝衔接。

using MessageBox = MessageWindowWPF.MessageBox; //添加这行即可

  MessageBox.Show("消息!");
  MessageBox.Show("消息2!", "提示", MessageBoxButton.OK, MessageBoxImage.Information);

MessageBox-richtext
如果想要显示富文本,也只需传入参数即可:

using MessageBox = MessageWindowWPF.MessageBox; 

  List<Inline> inlines = new List<Inline>();
  inlines.Add(new Run("普通文本。 "));
  inlines.Add(new Run("红色文本。") { Foreground = Brushes.Red });
  MessageBox.Show(inlines, "提示", MessageBoxButton.OK, MessageBoxImage.Information);

还可以自定义一些配置:

using MessageWindowWPF;
using MessageBox = MessageWindowWPF.MessageBox;

  MessageSetting.NoSystemHeader = MessageSetting.settings.WithCornerRadius = true;//不使用系统标题栏,以及变为圆角
  MessageSetting.UseDarkTheme = true;//设置明暗主题。默认是亮主题
  //MessageSetting.CustomColor = new MessageSetting.CustomColorData() { WindowText = Colors.Red };//甚至完全自定义文本和背景等颜色
  MessageBox.Show("消息!", "提示", MessageBoxButton.OK, MessageBoxImage.Information);

输入框(InputBox)

InputBox
类似于VB组件的输入框

using MessageWindowWPF;

  InputBox inputBox = new InputBox();
  if (inputBox.ShowDialog("输入提示:", "标题") == true)
    Console.WriteLine(inputBox.value);

函数: inputBox.ShowDialog(string message = null, string title = null, string defaultValue = null), 返回 bool?。

还可以自定义一些配置:

using MessageWindowWPF;

  MessageSetting.NoSystemHeader = MessageSetting.settings.WithCornerRadius = true;
  MessageSetting.UseDarkTheme = true;
  InputBox inputBox = new InputBox();
  if (inputBox.ShowDialog("输入提示:", "标题") == true)
    Console.WriteLine(inputBox.value);

提示(Prompt)

Prompt
淡入和淡出的提示,支持倒计时和双击关闭。

using MessageWindowWPF;

  Prompt.Show("提示文字");

函数: Prompt.Show(string content, double liveSeconds = 3, Window owner = null, Point? point = null, Color? backColor = null), 返回提示窗体。
当"liveSeconds" 的参数值<=0时,窗口将会一直显示直到双击关闭它。

Prompt-richtext
如果想要显示富文本,也只需传入参数即可:

using MessageWindowWPF;

  List<Inline> inlines = new List<Inline>();
  inlines.Add(new Run("普通文本。 "));
  inlines.Add(new Run("红色文本。") { Foreground = Brushes.Red });
  Prompt.Show(inlines);

自定义配置只有颜色有作用,但是调用函数的颜色参数优先级更高:

using MessageWindowWPF;
  MessageSetting.UseDarkTheme = true;
  //MessageSetting.CustomColor = new MessageSetting.CustomColorData() { WindowText = Colors.Red };
  Prompt.Show("提示文字");

其他说明

  • 因为只有四个按钮,所以目前的文字只带有中文和英文。 默认按当前语言显示,另外还可以通过改变 MessageSetting.settings.UIculture 的值来手动设置它。

Version

  • v1.1.0 2022/11/06 增加明暗主题支持,简化设置,允许完全自定义颜色。
  • v1.0.0 2022/12/07 基本功能.
Product 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.  net6.0-windows7.0 is compatible.  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 was computed.  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 netcoreapp3.1 is compatible. 
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 3.1

    • No dependencies.
  • .NETFramework 4.7.2

    • No dependencies.
  • net6.0-windows7.0

    • No dependencies.

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
2.2.0 230 7/18/2025
2.1.0 991 4/23/2025
2.0.0 227 4/22/2025
1.2.0 215 3/21/2025
1.1.0 213 11/5/2024
1.0.0 501 12/7/2022