AutoCompleteBoxStyles.axaml 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  2. <Design.PreviewWith>
  3. <Border Width="300"
  4. Padding="20"
  5. Background="{DynamicResource SukiBackground}">
  6. <StackPanel>
  7. <AutoCompleteBox />
  8. </StackPanel>
  9. </Border>
  10. </Design.PreviewWith>
  11. <ControlTheme x:Key="{x:Type AutoCompleteBox}" TargetType="AutoCompleteBox">
  12. <Setter Property="BorderThickness" Value="0,0,0,1" />
  13. <Setter Property="MinWidth" Value="100" />
  14. <Setter Property="BorderBrush" Value="{DynamicResource SukiControlBorderBrush}" />
  15. <Setter Property="CornerRadius" Value="0" />
  16. <Setter Property="Background" Value="{DynamicResource SukiBackground}" />
  17. <Setter Property="Padding" Value="4" />
  18. <Setter Property="Template">
  19. <ControlTemplate>
  20. <Panel>
  21. <TextBox Name="PART_TextBox"
  22. Padding="{TemplateBinding Padding}"
  23. Background="{TemplateBinding Background}"
  24. BorderBrush="{TemplateBinding BorderBrush}"
  25. BorderThickness="{TemplateBinding BorderThickness}"
  26. CornerRadius="{TemplateBinding CornerRadius}"
  27. DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}"
  28. Watermark="{TemplateBinding Watermark}" />
  29. <Popup Name="PART_Popup"
  30. MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}"
  31. MaxHeight="{TemplateBinding MaxDropDownHeight}"
  32. IsLightDismissEnabled="True"
  33. PlacementTarget="{TemplateBinding}">
  34. <Border Margin="0,-15,0,0" Padding="5,10,5,5">
  35. <Panel>
  36. <Border Margin="0,10,0,0"
  37. Background="{DynamicResource SukiCardBackground}"
  38. BorderBrush="{DynamicResource SukiControlBorderBrush}"
  39. BorderThickness="1,1,1,1"
  40. BoxShadow="{DynamicResource SukiPopupShadow}"
  41. CornerRadius="{DynamicResource SmallCornerRadius}">
  42. <Panel Background="{DynamicResource PopupGradientBrush}">
  43. <ListBox Name="PART_SelectingItemsControl"
  44. Background="{TemplateBinding Background}"
  45. BorderThickness="0"
  46. Foreground="{TemplateBinding Foreground}"
  47. ItemTemplate="{TemplateBinding ItemTemplate}"
  48. ScrollViewer.HorizontalScrollBarVisibility="Auto"
  49. ScrollViewer.VerticalScrollBarVisibility="Auto" />
  50. </Panel>
  51. </Border>
  52. </Panel>
  53. </Border>
  54. </Popup>
  55. </Panel>
  56. </ControlTemplate>
  57. </Setter>
  58. </ControlTheme>
  59. </ResourceDictionary>