fork download
  1. <Window.Resources>
  2.  
  3. <Style x:Key="DatePickerStyle1" TargetType="{x:Type Custom:DatePicker}">
  4. <Setter Property="Foreground" Value="#FF333333"/>
  5. <Setter Property="IsTodayHighlighted" Value="True"/>
  6. <Setter Property="SelectedDateFormat" Value="Short"/>
  7. <Setter Property="Background" Value="Transparent"/>
  8. <Setter Property="Padding" Value="2"/>
  9. <Setter Property="BorderBrush">
  10. <Setter.Value>
  11. <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
  12. <GradientStop Color="#FFA3AEB9" Offset="0"/>
  13. <GradientStop Color="#FF8399A9" Offset="0.375"/>
  14. <GradientStop Color="#FF718597" Offset="0.375"/>
  15. <GradientStop Color="#FF617584" Offset="1"/>
  16. </LinearGradientBrush>
  17. </Setter.Value>
  18. </Setter>
  19. <Setter Property="BorderThickness" Value="1"/>
  20. <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
  21. <Setter Property="Template">
  22. <Setter.Value>
  23. <ControlTemplate TargetType="{x:Type Custom:DatePicker}">
  24. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
  25. <VisualStateManager.VisualStateGroups>
  26. <VisualStateGroup x:Name="CommonStates">
  27. <VisualState x:Name="Normal"/>
  28. <VisualState x:Name="Disabled">
  29. <Storyboard>
  30. <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_DisabledVisual"/>
  31. </Storyboard>
  32. </VisualState>
  33. </VisualStateGroup>
  34. </VisualStateManager.VisualStateGroups>
  35. <Grid x:Name="PART_Root" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
  36. <Grid.Resources>
  37. <SolidColorBrush x:Key="DisabledBrush" Color="#A5FFFFFF"/>
  38. </Grid.Resources>
  39. <Grid.ColumnDefinitions>
  40. <ColumnDefinition Width="*"/>
  41. <ColumnDefinition Width="Auto"/>
  42. </Grid.ColumnDefinitions>
  43. <Button x:Name="PART_Button" Grid.Column="1" Foreground="{TemplateBinding Foreground}" Focusable="False" HorizontalAlignment="Left" Margin="3,0" Grid.Row="0" VerticalAlignment="Top" Width="20">
  44. <Button.Template>
  45. <ControlTemplate TargetType="{x:Type Button}">
  46. <Grid>
  47. <VisualStateManager.VisualStateGroups>
  48. <VisualStateGroup x:Name="CommonStates">
  49. <VisualStateGroup.Transitions>
  50. <VisualTransition From="{x:Null}" GeneratedDuration="0" Storyboard="{x:Null}" To="{x:Null}"/>
  51. <VisualTransition From="{x:Null}" GeneratedDuration="0:0:0.1" Storyboard="{x:Null}" To="MouseOver"/>
  52. <VisualTransition From="{x:Null}" GeneratedDuration="0:0:0.1" Storyboard="{x:Null}" To="Pressed"/>
  53. </VisualStateGroup.Transitions>
  54. <VisualState x:Name="Normal"/>
  55. <VisualState x:Name="MouseOver">
  56. <Storyboard>
  57. <ColorAnimation Duration="0" To="#FF448DCA" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="Background"/>
  58. <ColorAnimationUsingKeyFrames BeginTime="0" Duration="0:0:0.001" Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient">
  59. <SplineColorKeyFrame KeyTime="0" Value="#7FFFFFFF"/>
  60. </ColorAnimationUsingKeyFrames>
  61. <ColorAnimationUsingKeyFrames BeginTime="0" Duration="0:0:0.001" Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient">
  62. <SplineColorKeyFrame KeyTime="0" Value="#CCFFFFFF"/>
  63. </ColorAnimationUsingKeyFrames>
  64. <ColorAnimationUsingKeyFrames BeginTime="0" Duration="0:0:0.001" Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient">
  65. <SplineColorKeyFrame KeyTime="0" Value="#F2FFFFFF"/>
  66. </ColorAnimationUsingKeyFrames>
  67. </Storyboard>
  68. </VisualState>
  69. <VisualState x:Name="Pressed">
  70. <Storyboard>
  71. <ColorAnimationUsingKeyFrames BeginTime="0" Duration="0:0:0.001" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="Background">
  72. <SplineColorKeyFrame KeyTime="0" Value="#FF448DCA"/>
  73. </ColorAnimationUsingKeyFrames>
  74. <DoubleAnimationUsingKeyFrames BeginTime="0" Duration="0:0:0.001" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Highlight">
  75. <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
  76. </DoubleAnimationUsingKeyFrames>
  77. <ColorAnimationUsingKeyFrames BeginTime="0" Duration="0:0:0.001" Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient">
  78. <SplineColorKeyFrame KeyTime="0" Value="#EAFFFFFF"/>
  79. </ColorAnimationUsingKeyFrames>
  80. <ColorAnimationUsingKeyFrames BeginTime="0" Duration="0:0:0.001" Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient">
  81. <SplineColorKeyFrame KeyTime="0" Value="#C6FFFFFF"/>
  82. </ColorAnimationUsingKeyFrames>
  83. <ColorAnimationUsingKeyFrames BeginTime="0" Duration="0:0:0.001" Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient">
  84. <SplineColorKeyFrame KeyTime="0" Value="#6BFFFFFF"/>
  85. </ColorAnimationUsingKeyFrames>
  86. <ColorAnimationUsingKeyFrames BeginTime="0" Duration="0:0:0.001" Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient">
  87. <SplineColorKeyFrame KeyTime="0" Value="#F4FFFFFF"/>
  88. </ColorAnimationUsingKeyFrames>
  89. </Storyboard>
  90. </VisualState>
  91. <VisualState x:Name="Disabled"/>
  92. </VisualStateGroup>
  93. </VisualStateManager.VisualStateGroups>
  94. <Grid Background="#11FFFFFF" FlowDirection="LeftToRight" HorizontalAlignment="Center" Height="18" Margin="0" VerticalAlignment="Center" Width="19">
  95. <Grid.ColumnDefinitions>
  96. <ColumnDefinition Width="20*"/>
  97. <ColumnDefinition Width="20*"/>
  98. <ColumnDefinition Width="20*"/>
  99. <ColumnDefinition Width="20*"/>
  100. </Grid.ColumnDefinitions>
  101. <Grid.RowDefinitions>
  102. <RowDefinition Height="23*"/>
  103. <RowDefinition Height="19*"/>
  104. <RowDefinition Height="19*"/>
  105. <RowDefinition Height="19*"/>
  106. </Grid.RowDefinitions>
  107. <Border x:Name="Highlight" BorderBrush="#FF45D6FA" BorderThickness="1" Grid.ColumnSpan="4" CornerRadius="0,0,1,1" Margin="-1" Opacity="0" Grid.Row="0" Grid.RowSpan="4"/>
  108. <Border x:Name="Background" BorderBrush="White" BorderThickness="1" Background="#FF1F3B53" Grid.ColumnSpan="4" CornerRadius="0.5" Margin="0,-1,0,0" Opacity="1" Grid.Row="1" Grid.RowSpan="3"/>
  109. <Border x:Name="BackgroundGradient" BorderBrush="#BF000000" BorderThickness="1" Grid.ColumnSpan="4" CornerRadius="0.5" Margin="0,-1,0,0" Opacity="1" Grid.Row="1" Grid.RowSpan="3">
  110. <Border.Background>
  111. <LinearGradientBrush EndPoint="0.7,1" StartPoint="0.7,0">
  112. <GradientStop Color="White" Offset="0"/>
  113. <GradientStop Color="#F9FFFFFF" Offset="0.375"/>
  114. <GradientStop Color="#E5FFFFFF" Offset="0.625"/>
  115. <GradientStop Color="#C6FFFFFF" Offset="1"/>
  116. </LinearGradientBrush>
  117. </Border.Background>
  118. </Border>
  119. <Rectangle Grid.ColumnSpan="4" Grid.RowSpan="1" StrokeThickness="1">
  120. <Rectangle.Fill>
  121. <LinearGradientBrush EndPoint="0.3,-1.1" StartPoint="0.46,1.6">
  122. <GradientStop Color="#FF4084BD"/>
  123. <GradientStop Color="#FFAFCFEA" Offset="1"/>
  124. </LinearGradientBrush>
  125. </Rectangle.Fill>
  126. <Rectangle.Stroke>
  127. <LinearGradientBrush EndPoint="0.48,-1" StartPoint="0.48,1.25">
  128. <GradientStop Color="#FF494949"/>
  129. <GradientStop Color="#FF9F9F9F" Offset="1"/>
  130. </LinearGradientBrush>
  131. </Rectangle.Stroke>
  132. </Rectangle>
  133. <Path Grid.ColumnSpan="4" Grid.Column="0" Data="M11.426758,8.4305077L11.749023,8.4305077 11.749023,16.331387 10.674805,16.331387 10.674805,10.299648 9.0742188,11.298672 9.0742188,10.294277C9.4788408,10.090176 9.9094238,9.8090878 10.365967,9.4510155 10.82251,9.0929432 11.176106,8.7527733 11.426758,8.4305077z M14.65086,8.4305077L18.566387,8.4305077 18.566387,9.3435936 15.671368,9.3435936 15.671368,11.255703C15.936341,11.058764 16.27293,10.960293 16.681133,10.960293 17.411602,10.960293 17.969301,11.178717 18.354229,11.615566 18.739157,12.052416 18.931622,12.673672 18.931622,13.479336 18.931622,15.452317 18.052553,16.438808 16.294415,16.438808 15.560365,16.438808 14.951641,16.234707 14.468243,15.826504L14.881817,14.929531C15.368796,15.326992 15.837872,15.525723 16.289043,15.525723 17.298809,15.525723 17.803692,14.895514 17.803692,13.635098 17.803692,12.460618 17.305971,11.873379 16.310528,11.873379 15.83071,11.873379 15.399232,12.079271 15.016094,12.491055L14.65086,12.238613z" Fill="#FF2F2F2F" HorizontalAlignment="Center" Margin="4,3" Grid.Row="1" Grid.RowSpan="3" RenderTransformOrigin="0.5,0.5" Stretch="Fill" VerticalAlignment="Center"/>
  134. <Ellipse Grid.ColumnSpan="4" Fill="White" HorizontalAlignment="Center" Height="3" StrokeThickness="0" VerticalAlignment="Center" Width="3"/>
  135. <Border x:Name="DisabledVisual" BorderBrush="#B2FFFFFF" BorderThickness="1" Grid.ColumnSpan="4" CornerRadius="0,0,0.5,0.5" Opacity="0" Grid.Row="0" Grid.RowSpan="4"/>
  136. </Grid>
  137. </Grid>
  138. </ControlTemplate>
  139. </Button.Template>
  140. </Button>
  141. <Custom:DatePickerTextBox x:Name="PART_TextBox" Text="Custom Text" Grid.Column="0" Foreground="{TemplateBinding Foreground}" Focusable="{TemplateBinding Focusable}" HorizontalContentAlignment="Stretch" Grid.Row="0" VerticalContentAlignment="Stretch"/>
  142. <Grid x:Name="PART_DisabledVisual" Grid.ColumnSpan="2" Grid.Column="0" IsHitTestVisible="False" Opacity="0" Grid.Row="0">
  143. <Grid.ColumnDefinitions>
  144. <ColumnDefinition Width="*"/>
  145. <ColumnDefinition Width="Auto"/>
  146. </Grid.ColumnDefinitions>
  147. <Rectangle Grid.Column="0" Fill="#A5FFFFFF" RadiusY="1" Grid.Row="0" RadiusX="1"/>
  148. <Rectangle Grid.Column="1" Fill="#A5FFFFFF" Height="18" Margin="3,0" RadiusY="1" Grid.Row="0" RadiusX="1" Width="19"/>
  149. <Popup x:Name="PART_Popup" AllowsTransparency="True" Placement="Bottom" StaysOpen="False"/>
  150. </Grid>
  151. </Grid>
  152. </Border>
  153. </ControlTemplate>
  154. </Setter.Value>
  155. </Setter>
  156. </Style>
  157.  
  158. </Window.Resources>
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty