Files
notify/Notify/Views/ToastWindow.axaml
chuan 5ce2c8a982 feat: Claude Code 原生 Windows 通知(C# / .NET 10 + Avalonia 12)
为 Claude Code 提供原生 Windows toast 通知:点击跳回原窗口、切回 Windows
Terminal 标签、跨虚拟桌面、调用方图标、非阻塞投递;NativeAOT 单文件分发。
2026-06-22 18:05:15 +08:00

60 lines
2.2 KiB
XML

<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="clr-namespace:Notify.ViewModels"
x:Class="Notify.Views.ToastWindow"
x:DataType="vm:ToastViewModel"
Width="340"
Height="92"
CanResize="False"
ShowInTaskbar="False"
ShowActivated="False"
Topmost="True"
WindowDecorations="None"
Background="Transparent"
TransparencyLevelHint="Transparent">
<Border x:Name="Root"
Background="#FF2B2B2B"
CornerRadius="10"
BorderThickness="2"
BorderBrush="#FF4B64B2"
BoxShadow="0 6 24 0 #80000000"
Padding="14"
PointerEntered="OnPointerEntered"
PointerExited="OnPointerExited"
PointerPressed="OnBodyPressed">
<Grid ColumnDefinitions="Auto,*,Auto" VerticalAlignment="Center">
<Image Grid.Column="0"
x:Name="IconImage"
Width="44" Height="44"
VerticalAlignment="Center"
Source="/Assets/claude.ico" />
<StackPanel Grid.Column="1" Margin="12,0,8,0" VerticalAlignment="Center" Spacing="2">
<TextBlock Text="{Binding Title}"
FontWeight="Bold"
FontSize="14"
Foreground="#FFFFFFFF"
TextTrimming="CharacterEllipsis" />
<TextBlock Text="{Binding Message}"
FontSize="12"
Foreground="#FFCCCCCC"
TextWrapping="Wrap"
MaxLines="2"
TextTrimming="CharacterEllipsis" />
</StackPanel>
<Button Grid.Column="2"
Content="✕"
VerticalAlignment="Top"
Padding="6,2"
FontSize="12"
Foreground="#FF888888"
Background="Transparent"
BorderThickness="0"
Click="OnCloseClick" />
</Grid>
</Border>
</Window>