CalendarWithClock.xaml 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:hc="clr-namespace:HandyControl.Controls"
  4. xmlns:langs="clr-namespace:HandyControl.Properties.Langs"
  5. xmlns:ex="clr-namespace:HandyControl.Tools.Extension">
  6. <Style x:Key="CalendarWithClockBaseStyle" TargetType="hc:CalendarWithClock">
  7. <Setter Property="Focusable" Value="False"/>
  8. <Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
  9. <Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
  10. <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
  11. <Setter Property="hc:TitleElement.Background" Value="{DynamicResource TitleBrush}"/>
  12. <Setter Property="BorderThickness" Value="0"/>
  13. <Setter Property="Margin" Value="8 0"/>
  14. <Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}"/>
  15. <Setter Property="Template">
  16. <Setter.Value>
  17. <ControlTemplate TargetType="hc:CalendarWithClock">
  18. <hc:SimplePanel Margin="0,4,0,8" HorizontalAlignment="Center" VerticalAlignment="Center">
  19. <Border CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Effect="{StaticResource EffectShadow2}"/>
  20. <Grid>
  21. <Grid.ColumnDefinitions>
  22. <ColumnDefinition Width="Auto"/>
  23. <ColumnDefinition Width="Auto"/>
  24. </Grid.ColumnDefinitions>
  25. <Grid.RowDefinitions>
  26. <RowDefinition Height="Auto"/>
  27. <RowDefinition/>
  28. <RowDefinition Height="Auto"/>
  29. </Grid.RowDefinitions>
  30. <Border Margin="4" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" Grid.ColumnSpan="2" Height="42" VerticalAlignment="Top" Background="{Binding Path=(hc:TitleElement.Background),RelativeSource={RelativeSource TemplatedParent}}"/>
  31. <ContentPresenter Grid.Column="0" Grid.Row="0" Grid.RowSpan="2" x:Name="PART_CalendarPresenter" Margin="-8,-4,-8,-8"/>
  32. <ContentPresenter Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" x:Name="PART_ClockPresenter" Margin="-8,-4,-8,-8"/>
  33. <Button Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Visibility="{TemplateBinding ShowConfirmButton,Converter={StaticResource Boolean2VisibilityConverter}}" Name="PART_ButtonConfirm" Content="{ex:Lang Key={x:Static langs:LangKeys.Confirm}}" HorizontalAlignment="Center" Margin="0,0,0,19" Width="180" VerticalAlignment="Bottom" Style="{StaticResource ButtonPrimary}"/>
  34. </Grid>
  35. </hc:SimplePanel>
  36. </ControlTemplate>
  37. </Setter.Value>
  38. </Setter>
  39. </Style>
  40. <Style TargetType="hc:CalendarWithClock" BasedOn="{StaticResource CalendarWithClockBaseStyle}"/>
  41. </ResourceDictionary>