DropDownMenuWindow.Theme.xaml
上传用户:huazai0421
上传日期:2008-05-30
资源大小:405k
文件大小:3k
源码类别:

SilverLight

开发平台:

C#

  1. <ResourceDictionary
  2.     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  3.     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:local="clr-namespace:ESRI.ArcGIS.Samples"
  5. xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows">
  6. <Style TargetType="local:DropDownMenuWindow">
  7. <Setter Property="Template">
  8. <Setter.Value>
  9. <ControlTemplate TargetType="local:DropDownMenuWindow">
  10. <Popup x:Name="Popup" IsOpen="True"
  11.    HorizontalOffset="{TemplateBinding HorizontalOffset}"
  12.    VerticalOffset="{TemplateBinding VerticalOffset}">
  13. <vsm:VisualStateManager.VisualStateGroups>
  14. <vsm:VisualStateGroup x:Name="CommonStates">
  15. <vsm:VisualState x:Name="Visible">
  16. <Storyboard BeginTime="00:00:00" Duration="00:00:0.25">
  17. <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" 
  18. Storyboard.TargetName="contentPresenter"
  19. Storyboard.TargetProperty="Visibility">
  20. <ObjectAnimationUsingKeyFrames.KeyFrames>
  21. <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible" />
  22. </ObjectAnimationUsingKeyFrames.KeyFrames>
  23. </ObjectAnimationUsingKeyFrames>
  24. <DoubleAnimation BeginTime="00:00:00" Storyboard.TargetName="contentPresenter" 
  25.  Storyboard.TargetProperty="Opacity" To="1"
  26. Duration="0:0:0.25" />
  27. </Storyboard>
  28. </vsm:VisualState>
  29. <vsm:VisualState x:Name="Hidden">
  30. <Storyboard BeginTime="00:00:00" Duration="0:0:.25">
  31. <ObjectAnimationUsingKeyFrames  BeginTime="00:00:00" 
  32. Storyboard.TargetName="contentPresenter"
  33. Storyboard.TargetProperty="Visibility">
  34. <ObjectAnimationUsingKeyFrames.KeyFrames>
  35. <DiscreteObjectKeyFrame KeyTime="0:0:0.25" Value="Collapsed" />
  36. </ObjectAnimationUsingKeyFrames.KeyFrames>
  37. </ObjectAnimationUsingKeyFrames>
  38. <DoubleAnimation BeginTime="0" 
  39.  Storyboard.TargetName="contentPresenter" 
  40.  Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:0.25" />
  41. </Storyboard>
  42. </vsm:VisualState>
  43. </vsm:VisualStateGroup>
  44. </vsm:VisualStateManager.VisualStateGroups>
  45. <ContentPresenter
  46. x:Name="contentPresenter"
  47. Opacity="0"
  48. Content="{TemplateBinding Content}"
  49. ContentTemplate="{TemplateBinding ContentTemplate}"
  50. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  51. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  52. Margin="{TemplateBinding Padding}">
  53. <ContentPresenter.Effect>
  54. <DropShadowEffect Color="Black" Direction="-45" BlurRadius="20" Opacity=".75" />
  55. </ContentPresenter.Effect>
  56. </ContentPresenter>
  57. </Popup>
  58. </ControlTemplate>
  59. </Setter.Value>
  60. </Setter>
  61. </Style>
  62. </ResourceDictionary>