Source

FlashCards / FlashCards / Card.xaml

Full commit
<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:dropShadow="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
    xmlns:local="clr-namespace:FlashCards" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" x:Class="FlashCards.Card"
    Title="Card" x:Name="CardWindow" Height="349" Width="467" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" Visibility="Visible" MouseDown="Window_MouseDown" FontSize="12" Closing="Window_Closing" Loaded="CardWindow_Loaded" KeyUp="CardWindow_KeyUp" Foreground="CadetBlue" mc:Ignorable="d" AllowsTransparency="True" WindowStyle="None" Background="Transparent">
    
    <Window.Resources>
        <Storyboard x:Key="closeStoryBoard" Completed="closeStoryBoard_Completed">
            <DoubleAnimation Storyboard.TargetName="CardWindow" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="0:0:0.5" FillBehavior="HoldEnd" />
        </Storyboard>
        <Storyboard x:Key="openStoryBoard">
            <DoubleAnimation Storyboard.TargetName="CardWindow" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.5" FillBehavior="HoldEnd" />
        </Storyboard>

        <ControlTemplate x:Key="textButtonTemplate" TargetType="{x:Type Button}">
            <TextBlock FontSize="16" FontWeight="Bold"><InlineUIContainer>
            		<ContentPresenter />
            	</InlineUIContainer></TextBlock>
        </ControlTemplate>
        <Style x:Key="textButtonStyle" TargetType="{x:Type Button}">
            <Setter Property="Foreground" Value="LightGray" />
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="true">
                    <Setter Property="Foreground" Value="Black" />
                </Trigger>
            </Style.Triggers>
        </Style>
    </Window.Resources>
    
    <Window.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <BeginStoryboard Storyboard="{StaticResource openStoryBoard}" />
        </EventTrigger>
    </Window.Triggers>

    <Page Margin="10">
    	<Grid Margin="0,0,2,2">
    		<Rectangle Fill="White" Stroke="Black">
    			<Rectangle.Effect>
    				<DropShadowEffect/>
    			</Rectangle.Effect>
    		</Rectangle>
    		<local:CardControl x:Name="cardControl" />
            
    		<Button Content="X" Template="{StaticResource textButtonTemplate}" Style="{StaticResource textButtonStyle}" Height="22" HorizontalAlignment="Right" x:Name="closeButton" VerticalAlignment="Top" Width="16" Margin="0,0,0,0" Click="closeButton_Click" />
    		<Button Content="_" Template="{StaticResource textButtonTemplate}" Style="{StaticResource textButtonStyle}" Height="22" x:Name="minimizeButton" VerticalAlignment="Top" Margin="418.287,0,0,0" Click="minimizeButton_Click" HorizontalAlignment="Left" Width="10.713" />
    	</Grid>
    </Page>
</Window>