-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFadingPopupControl.xaml
More file actions
37 lines (37 loc) · 2.28 KB
/
FadingPopupControl.xaml
File metadata and controls
37 lines (37 loc) · 2.28 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
<UserControl x:Class="Matrix_Elementary.FadingPopupControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d" BorderThickness="0" Margin="0">
<UserControl.Resources>
<Storyboard x:Name="StatusFader" x:Key="StatusFader" Completed="StatusFader_Completed">
<DoubleAnimation Storyboard.TargetName="popupLabel" Storyboard.TargetProperty="Opacity" From="1" To="0" BeginTime="0:0:0" Duration="0:0:1.3">
<DoubleAnimation.EasingFunction>
<ExponentialEase Exponent="10" EasingMode="EaseIn" />
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
<Style x:Key="MyLabelStyle" TargetType="Label">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Label}">
<Border BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
Padding="{TemplateBinding Padding}"
SnapsToDevicePixels="true"
CornerRadius="5">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<Popup Name="popup" Placement="Center" PopupAnimation="Fade" AllowsTransparency="True">
<Grid Background="Transparent">
<Label Style="{StaticResource MyLabelStyle}" Name="popupLabel" DockPanel.Dock="Bottom" HorizontalAlignment="Center" Foreground="Black" VerticalAlignment="Center" Background="#EEF5F5F5" Grid.Column="0" Grid.Row="0" FontSize="20"/>
</Grid>
</Popup>
</UserControl>