-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathNotificationWindow.axaml
More file actions
77 lines (72 loc) · 3.35 KB
/
Copy pathNotificationWindow.axaml
File metadata and controls
77 lines (72 loc) · 3.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="300" d:DesignHeight="80"
x:Class="ShowWrite.NotificationWindow"
Width="320"
SizeToContent="Height"
WindowStartupLocation="Manual"
CanResize="False"
Background="Transparent"
ExtendClientAreaToDecorationsHint="True"
ExtendClientAreaTitleBarHeightHint="-1"
ShowInTaskbar="False"
WindowDecorations="None"
Topmost="True">
<Border CornerRadius="12" Background="#2D2D2D" BorderBrush="#3D3D3D" BorderThickness="1">
<Grid RowDefinitions="*,Auto">
<Grid Grid.Row="0" ColumnDefinitions="*,Auto" Margin="16,12,12,12">
<TextBlock x:Name="MessageText"
Grid.Column="0"
Text=""
FontSize="14"
Foreground="White"
TextWrapping="Wrap"
VerticalAlignment="Center"/>
<Button Grid.Column="1"
Classes="close-btn"
Width="24"
Height="24"
Margin="8,0,0,0"
Click="CloseButton_Click">
<Path Fill="#B4B4B4" Data="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>
</Button>
</Grid>
<!-- 底部倒计时进度条:随剩余时间收缩,归零时自动关闭(VSCode 风格) -->
<Border Grid.Row="1" Height="3" CornerRadius="0,0,11,11">
<Border x:Name="ProgressFill"
Background="#4A9EFF"
CornerRadius="0,0,11,11"/>
</Border>
</Grid>
</Border>
<Window.Styles>
<Style Selector="Button.close-btn">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="CornerRadius" Value="6"/>
<Setter Property="Template">
<ControlTemplate>
<Border Background="{TemplateBinding Background}"
CornerRadius="{TemplateBinding CornerRadius}">
<ContentPresenter Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="Button.close-btn:pointerover">
<Setter Property="Background" Value="#33FFFFFF"/>
</Style>
<Style Selector="Button.close-btn:pointerover Path">
<Setter Property="Fill" Value="White"/>
</Style>
<Style Selector="Button.close-btn:pressed">
<Setter Property="Background" Value="#22FFFFFF"/>
</Style>
</Window.Styles>
</Window>