TimeSelectorButton.axaml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. xmlns:timeSelector="using:InABox.Avalonia.Components.TimeSelector">
  5. <Style Selector="components|TimeSelectorButton">
  6. <Style.Resources>
  7. <components:TimeSelectorTimeSpanFormatter x:Key="timeFormatter"/>
  8. </Style.Resources>
  9. <Setter Property="Template">
  10. <ControlTemplate>
  11. <Button Classes="Standard"
  12. Command="{Binding $parent[components:TimeSelectorButton].ClickCommand}">
  13. <Button.Styles>
  14. <Style Selector="Button.Standard">
  15. <Setter Property="CornerRadius" Value="{TemplateBinding CornerRadius}"/>
  16. <Setter Property="Padding" Value="{TemplateBinding Padding}"/>
  17. <Setter Property="Margin" Value="{TemplateBinding Margin}"/>
  18. <Setter Property="Background" Value="{TemplateBinding Background}"/>
  19. <Setter Property="Foreground" Value="{TemplateBinding Foreground}"/>
  20. <Setter Property="BorderBrush" Value="{TemplateBinding BorderBrush}"/>
  21. <Setter Property="BorderThickness" Value="{TemplateBinding BorderThickness}"/>
  22. </Style>
  23. </Button.Styles>
  24. <Button.Content>
  25. <MultiBinding Converter="{StaticResource timeFormatter}">
  26. <Binding Path="$parent[components:TimeSelectorButton].Time"/>
  27. <Binding Path="$parent[components:TimeSelectorButton]"/>
  28. </MultiBinding>
  29. </Button.Content>
  30. </Button>
  31. </ControlTemplate>
  32. </Setter>
  33. <Setter Property="BorderBrush" Value="{DynamicResource PrsButtonBorder}" />
  34. <Setter Property="BorderThickness">
  35. <Setter.Value>
  36. <DynamicResource ResourceKey="PrsBorderThickness" />
  37. </Setter.Value>
  38. </Setter>
  39. <Setter Property="Background" Value="{DynamicResource PrsButtonBackground}"/>
  40. <Setter Property="Foreground" Value="{DynamicResource PrsButtonForeground}" />
  41. <Setter Property="CornerRadius" Value="{DynamicResource PrsCornerRadius}" />
  42. <Setter Property="Padding" Value="10" />
  43. </Style>
  44. <Style Selector="timeSelector|TimeSelectorView TimePickerPresenter /template/ Grid#AcceptDismissGrid">
  45. <Setter Property="IsVisible" Value="False"/>
  46. </Style>
  47. </Styles>