RunningBlockBaseStyle.xaml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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. <Style x:Key="RunningBlockBaseStyle" BasedOn="{StaticResource BaseStyle}" TargetType="hc:RunningBlock">
  5. <Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}"/>
  6. <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
  7. <Setter Property="BorderThickness" Value="1"/>
  8. <Setter Property="Padding" Value="0,10"/>
  9. <Setter Property="Template">
  10. <Setter.Value>
  11. <ControlTemplate TargetType="hc:RunningBlock">
  12. <hc:RunningBorder CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" Padding="{TemplateBinding Padding}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
  13. <hc:SimplePanel ClipToBounds="True">
  14. <hc:SimplePanel HorizontalAlignment="Left" x:Name="PART_Panel">
  15. <ContentPresenter x:Name="PART_ContentElement" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Left">
  16. <ContentPresenter.RenderTransform>
  17. <TransformGroup>
  18. <TranslateTransform/>
  19. </TransformGroup>
  20. </ContentPresenter.RenderTransform>
  21. </ContentPresenter>
  22. </hc:SimplePanel>
  23. </hc:SimplePanel>
  24. </hc:RunningBorder>
  25. </ControlTemplate>
  26. </Setter.Value>
  27. </Setter>
  28. <Style.Triggers>
  29. <Trigger Property="Orientation" Value="Vertical">
  30. <Setter Property="Padding" Value="10,0"/>
  31. </Trigger>
  32. </Style.Triggers>
  33. </Style>
  34. </ResourceDictionary>