FlyoutPresenter.axaml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  2. <ControlTheme x:Key="SukiFlyoutPresenterStyle" TargetType="FlyoutPresenter">
  3. <Setter Property="HorizontalContentAlignment" Value="Stretch" />
  4. <Setter Property="VerticalContentAlignment" Value="Stretch" />
  5. <Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}" />
  6. <Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}" />
  7. <Setter Property="BorderThickness" Value="1" />
  8. <Setter Property="Padding" Value="4" />
  9. <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
  10. <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
  11. <Setter Property="TextElement.Foreground" Value="{DynamicResource SukiText}"/>
  12. <Setter Property="Cursor" Value="Arrow"/>
  13. <!-- <Setter Property="FlowDirection" Value="{TemplateBinding FlowDirection}"/> -->
  14. <Setter Property="Template">
  15. <ControlTemplate>
  16. <Border Name="LayoutRoot"
  17. Background="Transparent"
  18. BorderBrush="{TemplateBinding BorderBrush}"
  19. BorderThickness="0"
  20. CornerRadius="{TemplateBinding CornerRadius}">
  21. <Border.Transitions>
  22. <Transitions>
  23. <DoubleTransition Property="Opacity" Duration="0:0:0.3" />
  24. </Transitions>
  25. </Border.Transitions>
  26. <ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
  27. <ContentPresenter Margin="{TemplateBinding Padding}"
  28. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  29. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  30. HorizontalContentAlignment="Stretch"
  31. VerticalContentAlignment="Stretch"
  32. Content="{TemplateBinding Content}"
  33. ContentTemplate="{TemplateBinding ContentTemplate}" />
  34. </ScrollViewer>
  35. </Border>
  36. </ControlTemplate>
  37. </Setter>
  38. </ControlTheme>
  39. <ControlTheme x:Key="{x:Type FlyoutPresenter}"
  40. BasedOn="{StaticResource SukiFlyoutPresenterStyle}"
  41. TargetType="FlyoutPresenter" />
  42. </ResourceDictionary>