Reformatted XAML.

git-svn-id: https://svn.evolvesoftware.ch/repos/evolve.net/WPF/NotifyIcon@180 9f600761-6f11-4665-b6dc-0185e9171623
This commit is contained in:
Philipp Sumi
2013-11-17 13:07:50 +00:00
parent 008ea6ab2c
commit c261d99378

View File

@@ -1,118 +1,158 @@
<UserControl <UserControl x:Class="Samples.FancyBalloon"
x:Class="Samples.FancyBalloon" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:tb="http://www.hardcodet.net/taskbar"
xmlns:tb="http://www.hardcodet.net/taskbar" x:Name="me"
x:Name="me" Height="120"
Height="120" Width="240">
Width="240"> <UserControl.Resources>
<UserControl.Resources> <Storyboard x:Key="FadeIn">
<Storyboard x:Key="FadeIn"> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.Opacity)"> Storyboard.TargetName="grid"
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/> Storyboard.TargetProperty="(UIElement.Opacity)">
<SplineDoubleKeyFrame KeyTime="00:00:01" Value="0.95"/> <SplineDoubleKeyFrame KeyTime="00:00:00"
<SplineDoubleKeyFrame KeyTime="00:00:03" Value="0.95"/> Value="0" />
<!-- <SplineDoubleKeyFrame KeyTime="00:00:05" Value="0"/>--> <SplineDoubleKeyFrame KeyTime="00:00:01"
</DoubleAnimationUsingKeyFrames> Value="0.95" />
</Storyboard> <SplineDoubleKeyFrame KeyTime="00:00:03"
<Storyboard x:Key="HighlightCloseButton"> Value="0.95" />
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="imgClose" Storyboard.TargetProperty="(UIElement.Opacity)"> <!-- <SplineDoubleKeyFrame KeyTime="00:00:05" Value="0"/>-->
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.4"/> </DoubleAnimationUsingKeyFrames>
<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/> </Storyboard>
</DoubleAnimationUsingKeyFrames> <Storyboard x:Key="HighlightCloseButton">
</Storyboard> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
<Storyboard x:Key="FadeCloseButton"> Storyboard.TargetName="imgClose"
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="imgClose" Storyboard.TargetProperty="(UIElement.Opacity)"> Storyboard.TargetProperty="(UIElement.Opacity)">
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/> <SplineDoubleKeyFrame KeyTime="00:00:00"
<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0.4"/> Value="0.4" />
</DoubleAnimationUsingKeyFrames> <SplineDoubleKeyFrame KeyTime="00:00:00.3000000"
</Storyboard> Value="1" />
<Storyboard x:Key="FadeBack"> </DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.Opacity)"> </Storyboard>
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/> <Storyboard x:Key="FadeCloseButton">
<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
</DoubleAnimationUsingKeyFrames> Storyboard.TargetName="imgClose"
</Storyboard> Storyboard.TargetProperty="(UIElement.Opacity)">
<Storyboard x:Key="FadeOut" Completed="OnFadeOutCompleted" > <SplineDoubleKeyFrame KeyTime="00:00:00"
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.Opacity)"> Value="1" />
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/> <SplineDoubleKeyFrame KeyTime="00:00:00.3000000"
<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0.2"/> Value="0.4" />
</DoubleAnimationUsingKeyFrames> </DoubleAnimationUsingKeyFrames>
</Storyboard> </Storyboard>
</UserControl.Resources> <Storyboard x:Key="FadeBack">
<UserControl.Triggers> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
<EventTrigger RoutedEvent="tb:TaskbarIcon.BalloonShowing"> Storyboard.TargetName="grid"
<BeginStoryboard Storyboard="{StaticResource FadeIn}" x:Name="FadeIn_BeginStoryboard"/> Storyboard.TargetProperty="(UIElement.Opacity)">
</EventTrigger> <SplineDoubleKeyFrame KeyTime="00:00:00"
<EventTrigger RoutedEvent="Mouse.MouseEnter" SourceName="imgClose"> Value="1" />
<BeginStoryboard Storyboard="{StaticResource HighlightCloseButton}" x:Name="HighlightCloseButton_BeginStoryboard"/> <SplineDoubleKeyFrame KeyTime="00:00:00.3000000"
</EventTrigger> Value="1" />
<EventTrigger RoutedEvent="Mouse.MouseLeave" SourceName="imgClose"> </DoubleAnimationUsingKeyFrames>
<BeginStoryboard Storyboard="{StaticResource FadeCloseButton}" x:Name="FadeCloseButton_BeginStoryboard"/> </Storyboard>
</EventTrigger> <Storyboard x:Key="FadeOut"
<EventTrigger RoutedEvent="Mouse.MouseEnter"> Completed="OnFadeOutCompleted">
<StopStoryboard BeginStoryboardName="FadeIn_BeginStoryboard"/> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
<BeginStoryboard x:Name="FadeBack_BeginStoryboard1" Storyboard="{StaticResource FadeBack}"/> Storyboard.TargetName="grid"
</EventTrigger> Storyboard.TargetProperty="(UIElement.Opacity)">
<EventTrigger RoutedEvent="tb:TaskbarIcon.BalloonClosing"> <SplineDoubleKeyFrame KeyTime="00:00:00"
<BeginStoryboard Storyboard="{StaticResource FadeOut}" x:Name="FadeOut_BeginStoryboard"/> Value="1" />
</EventTrigger> <SplineDoubleKeyFrame KeyTime="00:00:00.3000000"
</UserControl.Triggers> Value="0.2" />
<Grid x:Name="grid" MouseEnter="grid_MouseEnter"> </DoubleAnimationUsingKeyFrames>
<Border </Storyboard>
HorizontalAlignment="Stretch" </UserControl.Resources>
Margin="5,5,5,5" <UserControl.Triggers>
BorderThickness="1,1,1,1" <EventTrigger RoutedEvent="tb:TaskbarIcon.BalloonShowing">
BorderBrush="#FF997137"> <BeginStoryboard Storyboard="{StaticResource FadeIn}"
<Border.Effect> x:Name="FadeIn_BeginStoryboard" />
<DropShadowEffect Color="#FF747474"/> </EventTrigger>
</Border.Effect> <EventTrigger RoutedEvent="Mouse.MouseEnter"
<Border.Background> SourceName="imgClose">
<LinearGradientBrush <BeginStoryboard Storyboard="{StaticResource HighlightCloseButton}"
EndPoint="0.5,1" x:Name="HighlightCloseButton_BeginStoryboard" />
StartPoint="0.5,0"> </EventTrigger>
<GradientStop <EventTrigger RoutedEvent="Mouse.MouseLeave"
Color="#FF4B4B4B" SourceName="imgClose">
Offset="0" /> <BeginStoryboard Storyboard="{StaticResource FadeCloseButton}"
<GradientStop x:Name="FadeCloseButton_BeginStoryboard" />
Color="#FF8F8F8F" </EventTrigger>
Offset="1" /> <EventTrigger RoutedEvent="Mouse.MouseEnter">
</LinearGradientBrush> <StopStoryboard BeginStoryboardName="FadeIn_BeginStoryboard" />
</Border.Background> <BeginStoryboard x:Name="FadeBack_BeginStoryboard1"
</Border> Storyboard="{StaticResource FadeBack}" />
<Image </EventTrigger>
HorizontalAlignment="Left" <EventTrigger RoutedEvent="tb:TaskbarIcon.BalloonClosing">
Margin="0,10,0,0" <BeginStoryboard Storyboard="{StaticResource FadeOut}"
Width="72" x:Name="FadeOut_BeginStoryboard" />
Source="/Images/Info.png" </EventTrigger>
Stretch="Fill" Height="72" VerticalAlignment="Top" /> </UserControl.Triggers>
<TextBlock <Grid x:Name="grid"
Margin="72,49.2,10,0" MouseEnter="grid_MouseEnter">
VerticalAlignment="Top" <Border HorizontalAlignment="Stretch"
Foreground="#FFECAD25" Margin="5,5,5,5"
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> BorderThickness="1,1,1,1"
<Path BorderBrush="#FF997137">
Fill="#FFFFFFFF" <Border.Effect>
Stretch="Fill" <DropShadowEffect Color="#FF747474" />
Margin="72,38.2,34,0" </Border.Effect>
VerticalAlignment="Top" <Border.Background>
Height="1" <LinearGradientBrush EndPoint="0.5,1"
Data="M26,107 L220.04123,107" SnapsToDevicePixels="True"> StartPoint="0.5,0">
<Path.Stroke> <GradientStop Color="#FF4B4B4B"
<LinearGradientBrush Offset="0" />
EndPoint="0.973,0.5" <GradientStop Color="#FF8F8F8F"
StartPoint="0.005,0.5"> Offset="1" />
<GradientStop </LinearGradientBrush>
Color="#00ECAD25" </Border.Background>
Offset="1" /> </Border>
<GradientStop <Image HorizontalAlignment="Left"
Color="#87ECAD25" Margin="0,10,0,0"
Offset="0" /> Width="72"
</LinearGradientBrush> Source="/Images/Info.png"
</Path.Stroke> Stretch="Fill"
</Path> Height="72"
<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"/> VerticalAlignment="Top" />
<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"/> <TextBlock Margin="72,49.2,10,0"
VerticalAlignment="Top"
Foreground="#FFECAD25"
TextWrapping="Wrap"><Run Text="This is a user control. The animation uses the attached "/><Run FontStyle="Italic"
FontWeight="Bold"
Text="BalloonShowing "/><Run Text="event."/></TextBlock>
<Path Fill="#FFFFFFFF"
Stretch="Fill"
Margin="72,38.2,34,0"
VerticalAlignment="Top"
Height="1"
Data="M26,107 L220.04123,107"
SnapsToDevicePixels="True">
<Path.Stroke>
<LinearGradientBrush EndPoint="0.973,0.5"
StartPoint="0.005,0.5">
<GradientStop Color="#00ECAD25"
Offset="1" />
<GradientStop Color="#87ECAD25"
Offset="0" />
</LinearGradientBrush>
</Path.Stroke>
</Path>
<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" />
<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" />
</Grid> </Grid>
</UserControl> </UserControl>