MessageBoxGuo 1.0.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package MessageBoxGuo --version 1.0.1
NuGet\Install-Package MessageBoxGuo -Version 1.0.1
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="MessageBoxGuo" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MessageBoxGuo" Version="1.0.1" />
<PackageReference Include="MessageBoxGuo" />
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 MessageBoxGuo --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MessageBoxGuo, 1.0.1"
#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 MessageBoxGuo@1.0.1
#: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=MessageBoxGuo&version=1.0.1
#tool nuget:?package=MessageBoxGuo&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
MessageBoxGuo
介绍
WPF信息提示气泡...
软件架构
软件架构说明 WPF .net framework
安装教程
使用说明
<Window
x:Class="MessageBoxGuoTests.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:MessageBoxGuoTests"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="WPF Alert弹框示例"
Width="800"
Height="600"
mc:Ignorable="d">
<Grid>
<StackPanel
Width="300"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<Button
Margin="10"
Background="#67C23A"
Click="SuccessButton_Click"
Content="成功提示(局部)"
Foreground="White" />
<Button
Margin="10"
Background="#F56C6C"
Click="ErrorButton_Click"
Content="错误提示(局部)"
Foreground="White" />
<Button
Margin="10"
Background="#E6A23C"
Click="WarningButton_Click"
Content="警告提示(局部)"
Foreground="White" />
<Button
Margin="10"
Background="#909399"
Click="InfoButton_Click"
Content="信息提示(局部)"
Foreground="White" />
<Button
Margin="10"
Background="#409EFF"
Click="CustomButton_Click"
Content="自定义提示(局部)"
Foreground="White" />
<Separator Height="20" Margin="10" />
<Button
Margin="10"
Background="#67C23A"
Click="GlobalSuccessButton_Click"
Content="成功提示(全局)"
Foreground="White" />
<Button
Margin="10"
Background="#F56C6C"
Click="GlobalErrorButton_Click"
Content="错误提示(全局)"
Foreground="White" />
<Button
Margin="10"
Background="#E6A23C"
Click="GlobalWarningButton_Click"
Content="警告提示(全局)"
Foreground="White" />
<Button
Margin="10"
Background="#909399"
Click="GlobalInfoButton_Click"
Content="信息提示(全局)"
Foreground="White" />
<Button
Margin="10"
Background="#409EFF"
Click="GlobalCustomButton_Click"
Content="自定义提示(全局)"
Foreground="White" />
<Separator Height="20" Margin="10" />
<Button
Margin="10"
Background="#FF1493"
Click="TestMultipleAlerts_Click"
Content="测试多个弹窗"
Foreground="White" />
<Button
Margin="10"
Background="#8A2BE2"
Click="TestMultipleGlobalAlerts_Click"
Content="测试多个全局弹窗"
Foreground="White" />
</StackPanel>
<Canvas
x:Name="AlertContainer"
Width="300"
Height="0"
Margin="20"
HorizontalAlignment="Right"
VerticalAlignment="Top" />
</Grid>
</Window>
using MessageBoxGuo;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;
namespace MessageBoxGuoTests
{
/// <summary>
/// MainWindow.xaml 的交互逻辑
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void SuccessButton_Click(object sender, RoutedEventArgs e)
{
AlertBox.Show("操作成功!", AlertType.Success, AlertContainer);
}
private void ErrorButton_Click(object sender, RoutedEventArgs e)
{
AlertBox.Show("操作失败,请重试。", AlertType.Error, AlertContainer);
}
private void WarningButton_Click(object sender, RoutedEventArgs e)
{
AlertBox.Show("警告:请注意操作权限。", AlertType.Warning, AlertContainer);
}
private void InfoButton_Click(object sender, RoutedEventArgs e)
{
AlertBox.Show("提示:系统将于今晚进行维护。", AlertType.Info, AlertContainer);
}
private void CustomButton_Click(object sender, RoutedEventArgs e)
{
AlertBox.Show("自定义消息:这是一个自定义样式的提示框。", AlertType.Info, AlertContainer, 5000, Brushes.Purple, Brushes.White);
}
private void GlobalSuccessButton_Click(object sender, RoutedEventArgs e)
{
AlertBox.ShowGlobal("全局操作成功!", AlertType.Success);
}
private void GlobalErrorButton_Click(object sender, RoutedEventArgs e)
{
AlertBox.ShowGlobal("全局操作失败,请重试。", AlertType.Error);
}
private void GlobalWarningButton_Click(object sender, RoutedEventArgs e)
{
AlertBox.ShowGlobal("全局警告:请注意操作权限。", AlertType.Warning);
}
private void GlobalInfoButton_Click(object sender, RoutedEventArgs e)
{
AlertBox.ShowGlobal("全局提示:系统将于今晚进行维护。", AlertType.Info);
}
private void GlobalCustomButton_Click(object sender, RoutedEventArgs e)
{
AlertBox.ShowGlobal("全局自定义消息:这是一个自定义样式的提示框。", AlertType.Info, 5000, Brushes.Purple, Brushes.White);
}
private void TestMultipleAlerts_Click(object sender, RoutedEventArgs e)
{
// 测试多个弹窗
for (int i = 1; i <= 5; i++)
{
int index = i;
DispatcherTimer timer = new DispatcherTimer
{
Interval = TimeSpan.FromMilliseconds(index * 500)
};
timer.Tick += (s, args) =>
{
timer.Stop();
AlertBox.Show($"测试消息 {index}", AlertType.Info, AlertContainer);
};
timer.Start();
}
}
private void TestMultipleGlobalAlerts_Click(object sender, RoutedEventArgs e)
{
// 测试多个全局弹窗
for (int i = 1; i <= 5; i++)
{
int index = i;
DispatcherTimer timer = new DispatcherTimer
{
Interval = TimeSpan.FromMilliseconds(index * 500)
};
timer.Tick += (s, args) =>
{
timer.Stop();
AlertBox.ShowGlobal($"全局测试消息 {index}", AlertType.Info);
};
timer.Start();
}
}
}
}
参与贡献
- Fork 本仓库
- 新建 Feat_xxx 分支
- 提交代码
- 新建 Pull Request
特技
- 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
- Gitee 官方博客 blog.gitee.com
- 你可以 https://gitee.com/explore 这个地址来了解 Gitee 上的优秀开源项目
- GVP 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
- Gitee 官方提供的使用手册 https://gitee.com/help
- Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 https://gitee.com/gitee-stars/
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
This package has 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.
1.0.1第一版