root / trunk / Pithos.Client.WPF / Shell / PithosBalloon.xaml @ 2f7c4288
History | View | Annotate | Download (6.9 kB)
1 |
<UserControl x:Class="Pithos.Client.WPF.Shell.PithosBalloon" |
---|---|
2 |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
3 |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
4 |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
5 |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
6 |
mc:Ignorable="d" |
7 |
xmlns:tb="http://www.hardcodet.net/taskbar" |
8 |
Width="250" |
9 |
xmlns:my="clr-namespace:Pithos.Client.WPF.Shell" > |
10 |
<UserControl.Resources> |
11 |
<Storyboard x:Key="FadeIn"> |
12 |
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.Opacity)"> |
13 |
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/> |
14 |
<SplineDoubleKeyFrame KeyTime="00:00:01" Value="0.95"/> |
15 |
<SplineDoubleKeyFrame KeyTime="00:00:03" Value="0.95"/> |
16 |
<!-- <SplineDoubleKeyFrame KeyTime="00:00:05" Value="0"/>--> |
17 |
</DoubleAnimationUsingKeyFrames> |
18 |
</Storyboard> |
19 |
<Storyboard x:Key="HighlightCloseButton"> |
20 |
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="imgClose" Storyboard.TargetProperty="(UIElement.Opacity)"> |
21 |
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.4"/> |
22 |
<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/> |
23 |
</DoubleAnimationUsingKeyFrames> |
24 |
</Storyboard> |
25 |
<Storyboard x:Key="FadeCloseButton"> |
26 |
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="imgClose" Storyboard.TargetProperty="(UIElement.Opacity)"> |
27 |
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/> |
28 |
<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0.4"/> |
29 |
</DoubleAnimationUsingKeyFrames> |
30 |
</Storyboard> |
31 |
<Storyboard x:Key="FadeBack"> |
32 |
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.Opacity)"> |
33 |
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/> |
34 |
<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/> |
35 |
</DoubleAnimationUsingKeyFrames> |
36 |
</Storyboard> |
37 |
<Storyboard x:Key="FadeOut" Completed="OnFadeOutCompleted" > |
38 |
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.Opacity)"> |
39 |
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/> |
40 |
<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0.2"/> |
41 |
</DoubleAnimationUsingKeyFrames> |
42 |
</Storyboard> |
43 |
<my:BalloonIconConverter x:Key="BalloonConverter" /> |
44 |
</UserControl.Resources> |
45 |
<UserControl.Triggers> |
46 |
<EventTrigger RoutedEvent="tb:TaskbarIcon.BalloonShowing"> |
47 |
<BeginStoryboard Storyboard="{StaticResource FadeIn}" x:Name="FadeIn_BeginStoryboard"/> |
48 |
</EventTrigger> |
49 |
<EventTrigger RoutedEvent="Mouse.MouseEnter" SourceName="imgClose"> |
50 |
<BeginStoryboard Storyboard="{StaticResource HighlightCloseButton}" x:Name="HighlightCloseButton_BeginStoryboard"/> |
51 |
</EventTrigger> |
52 |
<EventTrigger RoutedEvent="Mouse.MouseLeave" SourceName="imgClose"> |
53 |
<BeginStoryboard Storyboard="{StaticResource FadeCloseButton}" x:Name="FadeCloseButton_BeginStoryboard"/> |
54 |
</EventTrigger> |
55 |
<EventTrigger RoutedEvent="Mouse.MouseEnter"> |
56 |
<StopStoryboard BeginStoryboardName="FadeIn_BeginStoryboard"/> |
57 |
<BeginStoryboard x:Name="FadeBack_BeginStoryboard1" Storyboard="{StaticResource FadeBack}"/> |
58 |
</EventTrigger> |
59 |
<EventTrigger RoutedEvent="tb:TaskbarIcon.BalloonClosing"> |
60 |
<BeginStoryboard Storyboard="{StaticResource FadeOut}" x:Name="FadeOut_BeginStoryboard"/> |
61 |
</EventTrigger> |
62 |
</UserControl.Triggers> |
63 |
<Grid x:Name="grid" MouseEnter="grid_MouseEnter"> |
64 |
<Grid.ColumnDefinitions> |
65 |
<ColumnDefinition Width="Auto"/> |
66 |
<ColumnDefinition Width="*"/> |
67 |
<ColumnDefinition Width="Auto"/> |
68 |
</Grid.ColumnDefinitions> |
69 |
<Grid.RowDefinitions> |
70 |
<RowDefinition Height="30" MaxHeight="30" /> |
71 |
<RowDefinition Height="Auto" MinHeight="50" /> |
72 |
</Grid.RowDefinitions> |
73 |
<Border Grid.RowSpan="2" Grid.ColumnSpan="3" Grid.Row="0" Grid.Column="0" |
74 |
HorizontalAlignment="Stretch" |
75 |
Margin="5" |
76 |
BorderThickness="1,1,1,1" |
77 |
BorderBrush="#FF379991"> |
78 |
<Border.Effect> |
79 |
<DropShadowEffect Color="#FF747474"/> |
80 |
</Border.Effect> |
81 |
<Border.Background> |
82 |
<LinearGradientBrush |
83 |
EndPoint="0.5,1" |
84 |
StartPoint="0.5,0"> |
85 |
<GradientStop |
86 |
Color="#4085A5" |
87 |
Offset="0" /> |
88 |
<GradientStop |
89 |
Color="#D7E8F0" |
90 |
Offset="1" /> |
91 |
</LinearGradientBrush> |
92 |
</Border.Background> |
93 |
</Border> |
94 |
<StackPanel Grid.Column="0" Grid.Row="0" Grid.RowSpan="2" VerticalAlignment="Stretch"> |
95 |
<Image |
96 |
HorizontalAlignment="Left" |
97 |
Margin="10,17,10,0" |
98 |
Width="48" |
99 |
Stretch="None" Height="48" VerticalAlignment="Top" |
100 |
Source="/Images/Info.png"/> |
101 |
|
102 |
|
103 |
</StackPanel> |
104 |
<TextBlock Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" |
105 |
Margin="0,5,10,10" |
106 |
VerticalAlignment="Top" |
107 |
Foreground="Black" |
108 |
TextWrapping="Wrap" |
109 |
Text="{Binding Message,FallbackValue='This is a message'}" |
110 |
Width="Auto" Grid.RowSpan="2"> |
111 |
</TextBlock> |
112 |
|
113 |
<Path Grid.Column="1" Fill="#FFFFFFFF" |
114 |
Stretch="Fill" |
115 |
Margin="0,34,34,0" |
116 |
VerticalAlignment="Top" |
117 |
Height="1" |
118 |
Data="M26,107 L220.04123,107" SnapsToDevicePixels="True"> |
119 |
<Path.Stroke> |
120 |
<LinearGradientBrush |
121 |
EndPoint="0.973,0.5" |
122 |
StartPoint="0.005,0.5"> |
123 |
<GradientStop |
124 |
Color="#0025ECDD" |
125 |
Offset="1" /> |
126 |
<GradientStop |
127 |
Color="#8725ECDD" |
128 |
Offset="0" /> |
129 |
</LinearGradientBrush> |
130 |
</Path.Stroke> |
131 |
</Path> |
132 |
<TextBlock Grid.Column="1" Grid.ColumnSpan="2" Margin="0,10,10,0" VerticalAlignment="Top" Height="23.2" Text="{Binding Path=Title, FallbackValue='Pithos'}" TextWrapping="Wrap" Foreground="White" FontWeight="Bold"/> |
133 |
<Image Grid.Column="2" HorizontalAlignment="Right" Margin="0,10,10,0" VerticalAlignment="Top" Width="16" Height="16" Source="/Images/Close.png" Stretch="Fill" Opacity="0.7" ToolTip="Close Balloon" x:Name="imgClose" MouseDown="imgClose_MouseDown"/> |
134 |
</Grid> |
135 |
</UserControl> |