Changed the balloon to a custom PithosBalloon.xaml so we can control how long a ballo...
[pithos-ms-client] / trunk / Pithos.Client.WPF / Shell / PithosBalloon.xaml
1 <UserControl x:Class="Pithos.Client.WPF.Shell.PithosBalloon"\r
2              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"\r
3              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"\r
4              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" \r
5              xmlns:d="http://schemas.microsoft.com/expression/blend/2008" \r
6              mc:Ignorable="d" \r
7              xmlns:tb="http://www.hardcodet.net/taskbar"\r
8              d:DesignHeight="120" d:DesignWidth="240"\r
9              Height="120"\r
10              Width="240">\r
11     <UserControl.Resources>\r
12         <Storyboard x:Key="FadeIn">\r
13             <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.Opacity)">\r
14                 <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>\r
15                 <SplineDoubleKeyFrame KeyTime="00:00:01" Value="0.95"/>\r
16                 <SplineDoubleKeyFrame KeyTime="00:00:03" Value="0.95"/>\r
17                 <!--             <SplineDoubleKeyFrame KeyTime="00:00:05" Value="0"/>-->\r
18             </DoubleAnimationUsingKeyFrames>\r
19         </Storyboard>\r
20         <Storyboard x:Key="HighlightCloseButton">\r
21             <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="imgClose" Storyboard.TargetProperty="(UIElement.Opacity)">\r
22                 <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.4"/>\r
23                 <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>\r
24             </DoubleAnimationUsingKeyFrames>\r
25         </Storyboard>\r
26         <Storyboard x:Key="FadeCloseButton">\r
27             <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="imgClose" Storyboard.TargetProperty="(UIElement.Opacity)">\r
28                 <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>\r
29                 <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0.4"/>\r
30             </DoubleAnimationUsingKeyFrames>\r
31         </Storyboard>\r
32         <Storyboard x:Key="FadeBack">\r
33             <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.Opacity)">\r
34                 <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>\r
35                 <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>\r
36             </DoubleAnimationUsingKeyFrames>\r
37         </Storyboard>\r
38         <Storyboard x:Key="FadeOut" Completed="OnFadeOutCompleted" >\r
39             <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.Opacity)">\r
40                 <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>\r
41                 <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0.2"/>\r
42             </DoubleAnimationUsingKeyFrames>\r
43         </Storyboard>\r
44     </UserControl.Resources>\r
45     <UserControl.Triggers>\r
46         <EventTrigger RoutedEvent="tb:TaskbarIcon.BalloonShowing">\r
47             <BeginStoryboard Storyboard="{StaticResource FadeIn}" x:Name="FadeIn_BeginStoryboard"/>\r
48         </EventTrigger>\r
49         <EventTrigger RoutedEvent="Mouse.MouseEnter" SourceName="imgClose">\r
50             <BeginStoryboard Storyboard="{StaticResource HighlightCloseButton}" x:Name="HighlightCloseButton_BeginStoryboard"/>\r
51         </EventTrigger>\r
52         <EventTrigger RoutedEvent="Mouse.MouseLeave" SourceName="imgClose">\r
53             <BeginStoryboard Storyboard="{StaticResource FadeCloseButton}" x:Name="FadeCloseButton_BeginStoryboard"/>\r
54         </EventTrigger>\r
55         <EventTrigger RoutedEvent="Mouse.MouseEnter">\r
56             <StopStoryboard BeginStoryboardName="FadeIn_BeginStoryboard"/>\r
57             <BeginStoryboard x:Name="FadeBack_BeginStoryboard1" Storyboard="{StaticResource FadeBack}"/>\r
58         </EventTrigger>\r
59         <EventTrigger RoutedEvent="tb:TaskbarIcon.BalloonClosing">\r
60             <BeginStoryboard Storyboard="{StaticResource FadeOut}" x:Name="FadeOut_BeginStoryboard"/>\r
61         </EventTrigger>\r
62     </UserControl.Triggers>\r
63     <Grid>\r
64         <Border\r
65         HorizontalAlignment="Stretch"\r
66         Margin="5,5,5,5"\r
67         BorderThickness="1,1,1,1"\r
68         BorderBrush="#FF997137">\r
69          <Border.Effect>\r
70              <DropShadowEffect Color="#FF747474"/>\r
71          </Border.Effect>\r
72          <Border.Background>\r
73              <LinearGradientBrush\r
74             EndPoint="0.5,1"\r
75             StartPoint="0.5,0">\r
76                  <GradientStop\r
77               Color="#4085A5"\r
78               Offset="0" />\r
79                  <GradientStop\r
80               Color="#D7E8F0"\r
81               Offset="1" />\r
82              </LinearGradientBrush>\r
83          </Border.Background>\r
84      </Border>\r
85  <Image\r
86     HorizontalAlignment="Left"\r
87     Margin="0,10,0,0"\r
88     Width="48"\r
89     Source="/Images/PithosTaskbar.png"\r
90     Stretch="None" Height="72" VerticalAlignment="Top" />\r
91  <TextBlock\r
92     Margin="72,49.2,10,0"\r
93     VerticalAlignment="Top"\r
94     Foreground="Black"\r
95     TextWrapping="Wrap"><Run Text="This is a user control. The animation uses the attached " Language="de-ch"/><Run FontStyle="Italic" FontWeight="Bold" Text="BalloonShowing " Language="de-ch"/><Run Text="event." Language="de-ch"/></TextBlock>\r
96     \r
97     <Path\r
98        Fill="#FFFFFFFF"\r
99        Stretch="Fill"\r
100        Margin="72,38.2,34,0"\r
101        VerticalAlignment="Top"\r
102        Height="1"\r
103        Data="M26,107 L220.04123,107" SnapsToDevicePixels="True">\r
104         <Path.Stroke>\r
105            <LinearGradientBrush\r
106           EndPoint="0.973,0.5"\r
107           StartPoint="0.005,0.5">\r
108                <GradientStop\r
109             Color="#00ECAD25"\r
110             Offset="1" />\r
111                <GradientStop\r
112             Color="#87ECAD25"\r
113          Offset="0" />\r
114                 </LinearGradientBrush>\r
115             </Path.Stroke>\r
116         </Path>\r
117         <TextBlock Margin="72,10,10,0" VerticalAlignment="Top" Height="23.2" Text="{Binding Path=BalloonText, ElementName=me, Mode=Default}" TextWrapping="Wrap" Foreground="#FFECAD25" FontWeight="Bold"/>\r
118         <Image HorizontalAlignment="Right" Margin="0,10,10,0" VerticalAlignment="Top" Width="16" Height="16" Source="/Images/Close.png" Stretch="Fill" Opacity="0.4" ToolTip="Close Balloon" x:Name="imgClose" MouseDown="imgClose_MouseDown"/>\r
119     </Grid>\r
120 </UserControl>\r