<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:tb="http://www.hardcodet.net/taskbar"
    mc:Ignorable="d"
    x:Class="NotifyIconWpf.Sample.ShowCases.Showcase.FancyToolTip"
    x:Name="me"
    Width="285"
    Height="136"
    >
    <UserControl.Resources>
        <Storyboard x:Key="FadeIn">
            <DoubleAnimationUsingKeyFrames
                BeginTime="00:00:00"
                Storyboard.TargetName="border"
                Storyboard.TargetProperty="(UIElement.Opacity)"
                >
                <SplineDoubleKeyFrame
                    KeyTime="00:00:00"
                    Value="0"
                    />
                <SplineDoubleKeyFrame
                    KeyTime="00:00:01"
                    Value="1"
                    KeySpline="0,0,0.46,0.969"
                    />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames
                BeginTime="00:00:00"
                Storyboard.TargetName="image"
                Storyboard.TargetProperty="(UIElement.Opacity)"
                >
                <SplineDoubleKeyFrame
                    KeyTime="00:00:00"
                    Value="0.6"
                    />
                <SplineDoubleKeyFrame
                    KeyTime="00:00:01"
                    Value="1"
                    />
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="FadeOut">
            <DoubleAnimationUsingKeyFrames
                BeginTime="00:00:00"
                Storyboard.TargetName="border"
                Storyboard.TargetProperty="(UIElement.Opacity)"
                >
                <SplineDoubleKeyFrame
                    KeyTime="00:00:00"
                    Value="1"
                    />
                <SplineDoubleKeyFrame
                    KeyTime="00:00:01"
                    Value="0.25"
                    />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames
                BeginTime="00:00:00"
                Storyboard.TargetName="image"
                Storyboard.TargetProperty="(UIElement.Opacity)"
                >
                <SplineDoubleKeyFrame
                    KeyTime="00:00:00"
                    Value="1"
                    />
                <SplineDoubleKeyFrame
                    KeyTime="00:00:01"
                    Value="0.6"
                    />
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </UserControl.Resources>
    <UserControl.Triggers>
        <EventTrigger RoutedEvent="tb:TaskbarIcon.ToolTipOpened">
            <BeginStoryboard
                Storyboard="{StaticResource FadeIn}"
                x:Name="FadeIn_BeginStoryboard"
                />
        </EventTrigger>
        <EventTrigger RoutedEvent="tb:TaskbarIcon.ToolTipClose">
            <BeginStoryboard
                Storyboard="{StaticResource FadeOut}"
                x:Name="FadeOut_BeginStoryboard"
                />
        </EventTrigger>
    </UserControl.Triggers>

    <Grid
        x:Name="LayoutRoot"
        Height="Auto"
        >
        <Border
            HorizontalAlignment="Stretch"
            VerticalAlignment="Stretch"
            Width="Auto"
            Height="Auto"
            CornerRadius="6,6,6,6"
            BorderThickness="3,3,3,3"
            Margin="0,0,5,5"
            x:Name="border"
            >
            <Border.Effect>
                <DropShadowEffect Color="#FF7A7A7A" />
            </Border.Effect>
            <Border.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFFFD283" Offset="0" />
                    <GradientStop Color="#FFFFFFFF" Offset="1" />
                </LinearGradientBrush>
            </Border.Background>
        </Border>
        <Image
            HorizontalAlignment="Left"
            Margin="10,10,0,26"
            Width="72"
            Source="/Images/Info.png"
            Stretch="Fill"
            VerticalAlignment="Top"
            RenderTransformOrigin="0.792,0.486"
            x:Name="image"
            Height="72"
            >
            <Image.RenderTransform>
                <TransformGroup>
                    <ScaleTransform ScaleX="1" ScaleY="1" />
                    <SkewTransform AngleX="0" AngleY="0" />
                    <RotateTransform Angle="0" />
                    <TranslateTransform X="0" Y="0" />
                </TransformGroup>
            </Image.RenderTransform>
        </Image>
        <TextBlock
            Margin="82,10,20,0"
            TextWrapping="Wrap"
            Height="32"
            VerticalAlignment="Top"
            FontSize="16"
            FontWeight="Bold"
            Foreground="#FF575757"
            ><Run
                Text="This is a fancy ToolTip..."
                Language="de-ch"
                /></TextBlock>
        <TextBlock
            FontSize="12"
            FontWeight="Bold"
            Foreground="#FF141414"
            TextWrapping="Wrap"
            Margin="10,0,20,19"
            VerticalAlignment="Bottom"
            Text="{Binding ElementName=me, Path=InfoText}"
            x:Name="txtToolTipDetail"
            d:LayoutOverrides="Height"
            />
        <TextBlock
            FontSize="12"
            FontWeight="Normal"
            Foreground="#FF141414"
            TextWrapping="Wrap"
            Margin="82,42,20,44.96"
            x:Name="txtToolTipDetail_Copy"
            ><Run
                Text="Data binding is simple: The NotifyIcon sets the DataContext unless it's not already in use."
                Language="de-ch"
                /></TextBlock>
    </Grid>
</UserControl>