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

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:DraggableWindow">
  7. <Setter Property="Template">
  8. <Setter.Value>
  9. <ControlTemplate TargetType="local:DraggableWindow">
  10. <Grid x:Name="RootElement">
  11. <vsm:VisualStateManager.VisualStateGroups>
  12. <vsm:VisualStateGroup x:Name="CommonStates">
  13. <vsm:VisualState x:Name="Normal">
  14. <Storyboard>
  15. <DoubleAnimation BeginTime="00:00:00" Storyboard.TargetName="RootElement" Storyboard.TargetProperty="Opacity" To=".75" Duration="0:0:0.1" />
  16. </Storyboard>
  17. </vsm:VisualState>
  18. <vsm:VisualState x:Name="MouseOver">
  19. <Storyboard>
  20. <DoubleAnimation BeginTime="00:00:00" Storyboard.TargetName="RootElement" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.1" />
  21. </Storyboard>
  22. </vsm:VisualState>
  23. <vsm:VisualState x:Name="Dragging">
  24. <Storyboard>
  25. <DoubleAnimation BeginTime="00:00:00" Storyboard.TargetName="RootElement" Storyboard.TargetProperty="Opacity" To=".5" Duration="0:0:0.1" />
  26. </Storyboard>
  27. </vsm:VisualState>
  28. <vsm:VisualState x:Name="Focus">
  29. <Storyboard>
  30. <DoubleAnimation BeginTime="00:00:00" Storyboard.TargetName="RootElement" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.1" />
  31. </Storyboard>
  32. </vsm:VisualState>
  33. </vsm:VisualStateGroup>
  34. </vsm:VisualStateManager.VisualStateGroups>
  35. <Border BorderThickness="2" Background="Black" BorderBrush="#555555" CornerRadius="3">
  36. <Grid>
  37. <Grid.RowDefinitions>
  38. <RowDefinition Height="20" />
  39. <RowDefinition Height="*" />
  40. </Grid.RowDefinitions>
  41. <Grid x:Name="TopBar">
  42. <Grid.Background>
  43. <LinearGradientBrush x:Name="ReflectionGradient" Opacity=".5" StartPoint="0.5,0" EndPoint="0.5,1">
  44. <LinearGradientBrush.GradientStops>
  45. <GradientStop Color="#D0FFFFFF" Offset="0" />
  46. <GradientStop Color="#90FFFFFF" Offset="0.5" />
  47. <GradientStop Color="#60FFFFFF" Offset="0.5" />
  48. <GradientStop Color="#90FFFFFF" Offset="1" />
  49. </LinearGradientBrush.GradientStops>
  50. </LinearGradientBrush>
  51. </Grid.Background>
  52. <TextBlock Text="{TemplateBinding Title}" VerticalAlignment="Center" 
  53.    Margin="5,0,0,0"
  54.    Foreground="White" FontWeight="Bold" FontSize="12" />
  55. <Button HorizontalAlignment="Right" VerticalAlignment="Center" 
  56. Height="16" Width="15" Margin="0,0,2,0"
  57. x:Name="btnClose" Cursor="Hand" Padding="2"
  58. Style="{StaticResource darkButtonStyle}" >
  59. <Button.Content>
  60. <Image Source="/Images/CloseX.png" />
  61. </Button.Content>
  62. </Button>
  63. </Grid>
  64. <ScrollViewer Background="#333333" Grid.Row="1" 
  65. HorizontalScrollBarVisibility="Auto"
  66. Margin="0" Padding="0"
  67. VerticalScrollBarVisibility="Auto">
  68. <ContentPresenter
  69. x:Name="contentPresenter"
  70. Content="{TemplateBinding Content}"
  71. ContentTemplate="{TemplateBinding ContentTemplate}"
  72. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  73. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  74. Margin="{TemplateBinding Padding}"/>
  75. </ScrollViewer>
  76. </Grid>
  77. </Border>
  78. <Rectangle Fill="#00FFFFFF" Width="4" Cursor="Hand"
  79.    HorizontalAlignment="Right" x:Name="ResizeWidth" />
  80. <Rectangle Fill="#00FFFFFF" Height="4" Cursor="Hand"
  81.    VerticalAlignment="Bottom" x:Name="ResizeHeight" />
  82. <Grid.Effect>
  83. <DropShadowEffect Color="Black" Direction="-45" BlurRadius="20" Opacity=".75" />
  84. </Grid.Effect>
  85. </Grid>
  86. </ControlTemplate>
  87. </Setter.Value>
  88. </Setter>
  89. </Style>
  90. </ResourceDictionary>