<?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:DropDownMenu">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:DropDownMenu">
                    <StackPanel>
						<vsm:VisualStateManager.VisualStateGroups>
							<vsm:VisualStateGroup x:Name="CommonStates">
								<vsm:VisualState x:Name="Visible">
									<Storyboard BeginTime="0">
										<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Visibility">
											<ObjectAnimationUsingKeyFrames.KeyFrames>
												<DiscreteObjectKeyFrame KeyTime="00:00:00">
													<DiscreteObjectKeyFrame.Value>
														<Visibility>Visible</Visibility>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames.KeyFrames>
										</ObjectAnimationUsingKeyFrames>
										
										<DoubleAnimation BeginTime="0" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.1" />
									</Storyboard>
								</vsm:VisualState>
								<vsm:VisualState x:Name="Hidden">
									<Storyboard BeginTime="0:0:0">
										<ObjectAnimationUsingKeyFrames BeginTime="00:00:.15" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Visibility">
											<ObjectAnimationUsingKeyFrames.KeyFrames>
												<DiscreteObjectKeyFrame KeyTime="00:00:.15">
													<DiscreteObjectKeyFrame.Value>
														<Visibility>Collapsed</Visibility>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames.KeyFrames>
										</ObjectAnimationUsingKeyFrames>
										
										<DoubleAnimation BeginTime="0" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:0.15" />
									</Storyboard>
								</vsm:VisualState>
							</vsm:VisualStateGroup>
						</vsm:VisualStateManager.VisualStateGroups>

						<ContentPresenter Content="{TemplateBinding MenuHeader}" ContentTemplate="{TemplateBinding MenuHeaderTemplate}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" />
						
						<Popup x:Name="Popup" IsOpen="True">
							<ContentPresenter x:Name="contentPresenter" Visibility="Collapsed" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" />
							
						</Popup>
					</StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>