ShadowViewer.Controls.Notification
                              
                            
                                1.2.1
                            
                        
                    dotnet add package ShadowViewer.Controls.Notification --version 1.2.1
NuGet\Install-Package ShadowViewer.Controls.Notification -Version 1.2.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="ShadowViewer.Controls.Notification" Version="1.2.1" />
        
        
For projects that support PackageReference, copy this XML node into the project file to reference the package.
                    
    
    <PackageVersion Include="ShadowViewer.Controls.Notification" Version="1.2.1" />
<PackageReference Include="ShadowViewer.Controls.Notification" />
        
        
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 ShadowViewer.Controls.Notification --version 1.2.1
        
        
 The NuGet Team does not provide support for this client. Please contact its maintainers for support.
                    
    
    #r "nuget: ShadowViewer.Controls.Notification, 1.2.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 ShadowViewer.Controls.Notification@1.2.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=ShadowViewer.Controls.Notification&version=1.2.1
#tool nuget:?package=ShadowViewer.Controls.Notification&version=1.2.1
        
        
 The NuGet Team does not provide support for this client. Please contact its maintainers for support.
                    
    
    ShadowViewer.Controls.Notification
弹出通知控件
快速开始
首先需要在你要显示通知的页面初始化NotificationPanel
<Window
    x:Class="Test.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:scontrols="using:ShadowViewer.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:local="using:Test"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <Grid x:Name="Top" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> 
        <scontrols:NotificationPanel
            x:Name="TipContainerCenter"
            Margin="0,0,0,52"
            HorizontalAlignment="Center"
            VerticalAlignment="Bottom"
            Canvas.ZIndex="1"
            FlowDirection="RightToLeft"
            Orientation="Vertical"
            Visibility="Collapsed" />
    </Grid>
</Window>
后续只要调用通知方法即可
// 简单字符串内容
private void ButtonBase_OnClick4(object sender, RoutedEventArgs e)
{
    TipContainerCenter.Notify("测试Error", InfoBarSeverity.Error);
}
// 自定义弹出控件内容
private void ButtonBase_OnClick5(object sender, RoutedEventArgs e)
{
    TipContainerCenter.Notify(new InfoBar
    {
        Message = "Test",
        Severity = InfoBarSeverity.Error,
        IsClosable = false,
        IsIconVisible = true,
        IsOpen = true,
        Content = new Grid()
        {
            Children  =
            {
                new ProgressBar()
                {
                    IsIndeterminate = true
                }
            }
        },
        HorizontalAlignment = HorizontalAlignment.Center,
        FlowDirection = FlowDirection.LeftToRight
    }, displaySeconds:0);
}
鸣谢
Bili.Uwp - 哔哩客户端 - 参考了TipPopup实现
| Product | Versions Compatible and additional computed target framework versions. | 
|---|---|
| .NET | net6.0-windows10.0.19041 is compatible. net7.0-windows was computed. net8.0-windows was computed. net8.0-windows10.0.19041 is compatible. net9.0-windows was computed. net10.0-windows was computed. | 
        
        Compatible target framework(s)
    
    
        
        Included target framework(s) (in package)
    
    Learn more about Target Frameworks and .NET Standard.
- 
                                                    net6.0-windows10.0.19041- CommunityToolkit.WinUI.Animations (>= 8.0.240109)
- Microsoft.Windows.SDK.BuildTools (>= 10.0.22621.756)
- Microsoft.WindowsAppSDK (>= 1.4.230913002)
 
- 
                                                    net8.0-windows10.0.19041- CommunityToolkit.WinUI.Animations (>= 8.0.240109)
- Microsoft.Windows.SDK.BuildTools (>= 10.0.22621.756)
- Microsoft.WindowsAppSDK (>= 1.4.230913002)
 
NuGet packages (1)
Showing the top 1 NuGet packages that depend on ShadowViewer.Controls.Notification:
| Package | Downloads | 
|---|---|
| ShadowViewer.Core ✨ ShadowViewer Core | Development SDK✨ | 
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on ShadowViewer.Controls.Notification:
| Repository | Stars | 
|---|---|
| jayfunc/BetterLyrics 
                                                            Your dynamic lyrics display tool built with WinUI 3 and Win2D - works with in-app playback and other music players | 使用 WinUI 3 和 Win2D 打造的动态歌词显示工具 - 支持软件内播放及其他音乐播放器
                                                         |