DateSelectorButton.axaml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <Styles xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:components="using:InABox.Avalonia.Components">
  4. <Style Selector="components|DateSelectorButton">
  5. <Style.Resources>
  6. <components:DateSelectorDateTimeFormatter x:Key="dateFormatter"/>
  7. </Style.Resources>
  8. <Setter Property="Template">
  9. <ControlTemplate>
  10. <Button Classes="Standard"
  11. Command="{Binding $parent[components:DateSelectorButton].ClickCommand}">
  12. <Button.Styles>
  13. <Style Selector="Button.Standard">
  14. <Setter Property="CornerRadius" Value="{TemplateBinding CornerRadius}"/>
  15. <Setter Property="Padding" Value="{TemplateBinding Padding}"/>
  16. <Setter Property="Margin" Value="{TemplateBinding Margin}"/>
  17. <Setter Property="Background" Value="{TemplateBinding Background}"/>
  18. <Setter Property="Foreground" Value="{TemplateBinding Foreground}"/>
  19. <Setter Property="BorderBrush" Value="{TemplateBinding BorderBrush}"/>
  20. <Setter Property="BorderThickness" Value="{TemplateBinding BorderThickness}"/>
  21. </Style>
  22. </Button.Styles>
  23. <Button.Content>
  24. <MultiBinding Converter="{StaticResource dateFormatter}">
  25. <Binding Path="$parent[components:DateSelectorButton].Date"/>
  26. <Binding Path="$parent[components:DateSelectorButton]"/>
  27. </MultiBinding>
  28. </Button.Content>
  29. </Button>
  30. </ControlTemplate>
  31. </Setter>
  32. <Setter Property="BorderBrush" Value="{DynamicResource PrsButtonBorder}" />
  33. <Setter Property="BorderThickness">
  34. <Setter.Value>
  35. <DynamicResource ResourceKey="PrsBorderThickness" />
  36. </Setter.Value>
  37. </Setter>
  38. <Setter Property="Background" Value="{DynamicResource PrsButtonBackground}"/>
  39. <Setter Property="Foreground" Value="{DynamicResource PrsButtonForeground}" />
  40. <Setter Property="CornerRadius" Value="{DynamicResource PrsCornerRadius}" />
  41. <Setter Property="Padding" Value="10" />
  42. </Style>
  43. </Styles>