<?xml version="1.0" encoding="utf-8"?>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:ESRI.ArcGIS.SilverlightMapApp" xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows">
    <Style TargetType="local:DraggableWindow">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:DraggableWindow">
                    <Grid x:Name="RootElement">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal">
                                    <Storyboard>
                                        <DoubleAnimation BeginTime="00:00:00" Storyboard.TargetName="RootElement" Storyboard.TargetProperty="Opacity" To=".75" Duration="0:0:0.1" />
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation BeginTime="00:00:00" Storyboard.TargetName="RootElement" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.1" />
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Dragging">
                                    <Storyboard>
                                        <DoubleAnimation BeginTime="00:00:00" Storyboard.TargetName="RootElement" Storyboard.TargetProperty="Opacity" To=".5" Duration="0:0:0.1" />
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Focus">
                                    <Storyboard>
                                        <DoubleAnimation BeginTime="00:00:00" Storyboard.TargetName="RootElement" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.1" />
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Border BorderThickness="2" Background="{TemplateBinding Background}" BorderBrush="#555555" CornerRadius="3">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="20" />
                                    <RowDefinition Height="*" />
                                </Grid.RowDefinitions>
                                <Grid x:Name="TopBar">
                                    <Grid.Background>
                                        <LinearGradientBrush x:Name="ReflectionGradient" Opacity=".5" StartPoint="0.5,0" EndPoint="0.5,1">
                                            <LinearGradientBrush.GradientStops>
                                                <GradientStop Color="#70FFFFFF" Offset="0" />
                                                <GradientStop Color="#30FFFFFF" Offset="0.5" />
                                                <GradientStop Color="#00FFFFFF" Offset="0.5" />
                                                <GradientStop Color="#30FFFFFF" Offset="1" />
                                            </LinearGradientBrush.GradientStops>
                                        </LinearGradientBrush>
                                    </Grid.Background>

                                    <TextBlock Text="{TemplateBinding Title}" VerticalAlignment="Center" Margin="5,0,0,0" Foreground="White" FontWeight="Bold" FontSize="12" />

                                    <Button HorizontalAlignment="Right" VerticalAlignment="Center" Height="16" Width="15" Margin="0,0,2,0" x:Name="btnClose" Cursor="Hand" Padding="2">
                                        <Button.Content>
                                            <Image Source="Images/CloseX.png" />
                                        </Button.Content>
                                    </Button>
                                </Grid>
								<ContentPresenter Grid.Row="1" x:Name="contentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" />
                            </Grid>
                        </Border>
                        <Rectangle Fill="#00FFFFFF" Width="4" Cursor="Hand" HorizontalAlignment="Right" x:Name="ResizeWidth" />
                        <Rectangle Fill="#00FFFFFF" Height="4" Cursor="Hand" VerticalAlignment="Bottom" x:Name="ResizeHeight" />
                        <Grid.Effect>
                            <DropShadowEffect Color="Black" Direction="-45" BlurRadius="20" Opacity=".75" />
                        </Grid.Effect>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>