|
1 |
| -<ResourceDictionary |
2 |
| - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
3 |
| - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
4 |
| - xmlns:controls="clr-namespace:Enterwell.Clients.Wpf.Notifications.Controls" |
5 |
| - xmlns:local="clr-namespace:Enterwell.Clients.Wpf.Notifications"> |
| 1 | +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 2 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 3 | + xmlns:controls="clr-namespace:Enterwell.Clients.Wpf.Notifications.Controls" |
| 4 | + xmlns:local="clr-namespace:Enterwell.Clients.Wpf.Notifications"> |
6 | 5 |
|
7 | 6 | <SolidColorBrush x:Key="NotificationButtonDarkBackgroundOverlayBrush">#333333</SolidColorBrush>
|
8 | 7 | <SolidColorBrush x:Key="NotificationButtonDarkBackgroundOverlayPressedBrush">#666666</SolidColorBrush>
|
9 | 8 | <SolidColorBrush x:Key="NotificationButtonDarkBackgroundOverlayDisabledBrush">#FFFFFF</SolidColorBrush>
|
10 | 9 |
|
11 | 10 | <Style x:Key="NotificationBadgeBaseStyle" TargetType="{x:Type TextBlock}">
|
| 11 | + <Setter Property="FontSize" Value="11" /> |
| 12 | + <Setter Property="FontWeight" Value="Bold" /> |
| 13 | + <Setter Property="Foreground" Value="White" /> |
| 14 | + <Setter Property="HorizontalAlignment" Value="Center" /> |
12 | 15 | <Setter Property="Margin" Value="10,2,0,2" />
|
13 | 16 | <Setter Property="Padding" Value="4,2" />
|
14 |
| - <Setter Property="HorizontalAlignment" Value="Center" /> |
15 | 17 | <Setter Property="VerticalAlignment" Value="Center" />
|
16 |
| - <Setter Property="FontSize" Value="11" /> |
17 |
| - <Setter Property="Foreground" Value="White" /> |
18 |
| - <Setter Property="FontWeight" Value="Bold" /> |
19 | 18 | </Style>
|
20 | 19 |
|
21 | 20 | <Style x:Key="NotificationHeaderTextStyle" TargetType="{x:Type TextBlock}">
|
22 |
| - <Setter Property="Foreground" Value="White" /> |
23 |
| - <Setter Property="FontWeight" Value="Light" /> |
24 | 21 | <Setter Property="FontSize" Value="16" />
|
| 22 | + <Setter Property="FontWeight" Value="Light" /> |
| 23 | + <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type controls:NotificationMessage}}, Path=Foreground}" /> |
25 | 24 | <Setter Property="Margin" Value="0,0,8,0" />
|
26 | 25 | <Setter Property="TextWrapping" Value="Wrap" />
|
27 | 26 | </Style>
|
28 | 27 |
|
29 | 28 | <Style x:Key="NotificationMessageTextStyle" TargetType="{x:Type TextBlock}">
|
30 |
| - <Setter Property="VerticalAlignment" Value="Center" /> |
31 | 29 | <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type controls:NotificationMessage}}, Path=Foreground}" />
|
32 |
| - <Setter Property="TextWrapping" Value="Wrap" /> |
33 | 30 | <Setter Property="Margin" Value="0,0,8,0" />
|
| 31 | + <Setter Property="TextWrapping" Value="Wrap" /> |
| 32 | + <Setter Property="VerticalAlignment" Value="Center" /> |
34 | 33 | </Style>
|
35 | 34 |
|
36 | 35 | <Style x:Key="NotificationMessageButtonStyle" TargetType="{x:Type Button}">
|
37 | 36 | <Setter Property="Foreground" Value="#EAEAEA" />
|
38 |
| - <Setter Property="Padding" Value="12,2" /> |
39 |
| - <Setter Property="VerticalContentAlignment" Value="Center" /> |
40 | 37 | <Setter Property="HorizontalContentAlignment" Value="Center" />
|
| 38 | + <Setter Property="Padding" Value="12,2" /> |
41 | 39 | <Setter Property="Template">
|
42 | 40 | <Setter.Value>
|
43 | 41 | <ControlTemplate TargetType="{x:Type Button}">
|
44 | 42 | <Grid>
|
45 |
| - <Border |
46 |
| - x:Name="backgroundBorder" |
47 |
| - Background="{TemplateBinding Background}" |
48 |
| - BorderBrush="{TemplateBinding Background}" |
49 |
| - BorderThickness="{TemplateBinding BorderThickness}" |
50 |
| - SnapsToDevicePixels="True" /> |
51 |
| - <Border |
52 |
| - x:Name="backgroundOverlay" |
53 |
| - BorderThickness="0" |
54 |
| - Opacity="0.3" |
55 |
| - SnapsToDevicePixels="True" /> |
56 |
| - <ContentPresenter |
57 |
| - x:Name="contentPresenter" |
58 |
| - Margin="{TemplateBinding Padding}" |
59 |
| - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
60 |
| - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
61 |
| - Content="{TemplateBinding Content}" |
62 |
| - ContentStringFormat="{TemplateBinding ContentStringFormat}" |
63 |
| - ContentTemplate="{TemplateBinding ContentTemplate}" |
64 |
| - Focusable="False" |
65 |
| - RecognizesAccessKey="True" |
66 |
| - SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> |
| 43 | + <Border x:Name="backgroundBorder" |
| 44 | + Background="{TemplateBinding Background}" |
| 45 | + BorderBrush="{TemplateBinding Background}" |
| 46 | + BorderThickness="{TemplateBinding BorderThickness}" |
| 47 | + SnapsToDevicePixels="True" /> |
| 48 | + <Border x:Name="backgroundOverlay" |
| 49 | + BorderThickness="0" |
| 50 | + Opacity="0.3" |
| 51 | + SnapsToDevicePixels="True" /> |
| 52 | + <ContentPresenter x:Name="contentPresenter" |
| 53 | + Margin="{TemplateBinding Padding}" |
| 54 | + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
| 55 | + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
| 56 | + Content="{TemplateBinding Content}" |
| 57 | + ContentStringFormat="{TemplateBinding ContentStringFormat}" |
| 58 | + ContentTemplate="{TemplateBinding ContentTemplate}" |
| 59 | + Focusable="False" |
| 60 | + RecognizesAccessKey="True" |
| 61 | + SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> |
67 | 62 | </Grid>
|
68 | 63 | <ControlTemplate.Triggers>
|
69 | 64 | <Trigger Property="Button.IsDefaulted" Value="True">
|
|
82 | 77 | </ControlTemplate>
|
83 | 78 | </Setter.Value>
|
84 | 79 | </Setter>
|
| 80 | + <Setter Property="VerticalContentAlignment" Value="Center" /> |
85 | 81 | </Style>
|
86 | 82 |
|
87 | 83 | <Style TargetType="{x:Type controls:NotificationMessage}">
|
88 | 84 | <Setter Property="Template">
|
89 | 85 | <Setter.Value>
|
90 | 86 | <ControlTemplate TargetType="{x:Type controls:NotificationMessage}">
|
91 |
| - <Border |
92 |
| - MinHeight="35" |
93 |
| - VerticalAlignment="Top" |
94 |
| - Background="{TemplateBinding Background}" |
95 |
| - BorderBrush="#882F2F2F" |
96 |
| - BorderThickness="0,0,0,1" |
97 |
| - SnapsToDevicePixels="True" |
98 |
| - UseLayoutRounding="True"> |
| 87 | + <Border MinHeight="35" |
| 88 | + VerticalAlignment="Top" |
| 89 | + Background="{TemplateBinding Background}" |
| 90 | + BorderBrush="#882F2F2F" |
| 91 | + BorderThickness="0,0,0,1" |
| 92 | + SnapsToDevicePixels="True" |
| 93 | + UseLayoutRounding="True"> |
99 | 94 | <Grid>
|
100 | 95 | <Grid.Resources>
|
101 | 96 | <!-- Accent button style -->
|
102 | 97 | <Style BasedOn="{StaticResource NotificationMessageButtonStyle}" TargetType="{x:Type controls:NotificationMessageButton}">
|
103 | 98 | <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type controls:NotificationMessage}}, Path=ButtonAccentBrush}" />
|
104 | 99 | </Style>
|
105 | 100 | <!-- Accent badge style -->
|
106 |
| - <Style |
107 |
| - x:Key="NotificationBadgeAccentStyle" |
108 |
| - BasedOn="{StaticResource NotificationBadgeBaseStyle}" |
109 |
| - TargetType="{x:Type TextBlock}"> |
| 101 | + <Style x:Key="NotificationBadgeAccentStyle" |
| 102 | + BasedOn="{StaticResource NotificationBadgeBaseStyle}" |
| 103 | + TargetType="{x:Type TextBlock}"> |
110 | 104 | <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type controls:NotificationMessage}}, Path=BadgeAccentBrush}" />
|
111 | 105 | </Style>
|
112 | 106 | </Grid.Resources>
|
|
117 | 111 | </Grid.ColumnDefinitions>
|
118 | 112 |
|
119 | 113 | <!-- Badge -->
|
120 |
| - <TextBlock |
121 |
| - Grid.Column="0" |
122 |
| - Style="{StaticResource NotificationBadgeAccentStyle}" |
123 |
| - Text="{TemplateBinding BadgeText}" |
124 |
| - Visibility="{TemplateBinding BadgeVisibility}" /> |
| 114 | + <TextBlock Grid.Column="0" |
| 115 | + Style="{StaticResource NotificationBadgeAccentStyle}" |
| 116 | + Text="{TemplateBinding BadgeText}" |
| 117 | + Visibility="{TemplateBinding BadgeVisibility}" /> |
| 118 | + |
| 119 | + <!-- Overlay content --> |
| 120 | + <ContentControl Grid.Column="0" |
| 121 | + Grid.ColumnSpan="3" |
| 122 | + HorizontalAlignment="Stretch" |
| 123 | + VerticalAlignment="Stretch" |
| 124 | + Content="{TemplateBinding OverlayContent}" /> |
125 | 125 |
|
126 | 126 | <!-- Header and message -->
|
127 | 127 | <Grid Grid.Column="1" Margin="10,8">
|
|
130 | 130 | <RowDefinition Height="*" />
|
131 | 131 | </Grid.RowDefinitions>
|
132 | 132 |
|
133 |
| - <TextBlock |
134 |
| - Grid.Row="0" |
135 |
| - Style="{StaticResource NotificationHeaderTextStyle}" |
136 |
| - Text="{TemplateBinding Header}" |
137 |
| - Visibility="{TemplateBinding HeaderVisibility}" /> |
| 133 | + <TextBlock Grid.Row="0" |
| 134 | + Style="{StaticResource NotificationHeaderTextStyle}" |
| 135 | + Text="{TemplateBinding Header}" |
| 136 | + Visibility="{TemplateBinding HeaderVisibility}" /> |
138 | 137 |
|
139 |
| - <TextBlock |
140 |
| - Grid.Row="1" |
141 |
| - Style="{StaticResource NotificationMessageTextStyle}" |
142 |
| - Text="{TemplateBinding Message}" |
143 |
| - Visibility="{TemplateBinding MessageVisibility}" /> |
| 138 | + <TextBlock Grid.Row="1" |
| 139 | + Style="{StaticResource NotificationMessageTextStyle}" |
| 140 | + Text="{TemplateBinding Message}" |
| 141 | + Visibility="{TemplateBinding MessageVisibility}" /> |
144 | 142 | </Grid>
|
145 | 143 |
|
146 | 144 | <!-- Buttons -->
|
|
156 | 154 | </DataTemplate>
|
157 | 155 | </ItemsControl.ItemTemplate>
|
158 | 156 | </ItemsControl>
|
159 |
| - |
160 |
| - <!-- Overlay content --> |
161 |
| - <ContentControl |
162 |
| - Grid.Column="0" |
163 |
| - Grid.ColumnSpan="3" |
164 |
| - HorizontalAlignment="Stretch" |
165 |
| - VerticalAlignment="Stretch" |
166 |
| - Content="{TemplateBinding OverlayContent}" /> |
167 | 157 | </Grid>
|
168 | 158 | </Border>
|
169 | 159 | </ControlTemplate>
|
|
180 | 170 | </Setter.Value>
|
181 | 171 | </Setter>
|
182 | 172 | <Setter Property="SnapsToDevicePixels" Value="True" />
|
183 |
| - <Setter Property="VerticalAlignment" Value="Top" /> |
184 | 173 | <Setter Property="Template">
|
185 | 174 | <Setter.Value>
|
186 | 175 | <ControlTemplate TargetType="{x:Type controls:NotificationMessageContainer}">
|
187 | 176 | <Grid>
|
188 |
| - <Border |
189 |
| - x:Name="ItemsBorder" |
190 |
| - Margin="12,0,12,12" |
191 |
| - Padding="{TemplateBinding Padding}" |
192 |
| - Background="{TemplateBinding Background}" |
193 |
| - SnapsToDevicePixels="true" |
194 |
| - UseLayoutRounding="True"> |
| 177 | + <Border x:Name="ItemsBorder" |
| 178 | + Margin="12,0,12,12" |
| 179 | + Padding="{TemplateBinding Padding}" |
| 180 | + Background="{TemplateBinding Background}" |
| 181 | + SnapsToDevicePixels="true" |
| 182 | + UseLayoutRounding="True"> |
195 | 183 | <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
|
196 | 184 | <ItemsPresenter.Effect>
|
197 |
| - <DropShadowEffect |
198 |
| - BlurRadius="10" |
199 |
| - Direction="270" |
200 |
| - Opacity="0.3" |
201 |
| - Color="Black" /> |
| 185 | + <DropShadowEffect BlurRadius="10" |
| 186 | + Direction="270" |
| 187 | + Opacity="0.3" |
| 188 | + Color="Black" /> |
202 | 189 | </ItemsPresenter.Effect>
|
203 | 190 | </ItemsPresenter>
|
204 | 191 | </Border>
|
205 | 192 | </Grid>
|
206 | 193 | </ControlTemplate>
|
207 | 194 | </Setter.Value>
|
208 | 195 | </Setter>
|
| 196 | + <Setter Property="VerticalAlignment" Value="Top" /> |
209 | 197 | </Style>
|
210 | 198 | </ResourceDictionary>
|
0 commit comments