SearchBar.axaml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:components="clr-namespace:InABox.Avalonia.Components"
  6. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="100"
  7. x:Class="InABox.Avalonia.Components.SearchBar"
  8. x:DataType="components:SearchBar">
  9. <Border Background="{StaticResource PrsTileBackground}"
  10. BorderThickness="{StaticResource PrsBorderThickness}"
  11. BorderBrush="{StaticResource PrsTileBorder}"
  12. CornerRadius="{StaticResource PrsCornerRadius}"
  13. Height="40"
  14. Padding="3">
  15. <Grid>
  16. <Grid.ColumnDefinitions>
  17. <ColumnDefinition Width="Auto"/>
  18. <ColumnDefinition Width="*"/>
  19. </Grid.ColumnDefinitions>
  20. <Image Classes="Small" Source="{SvgImage /Images/search.svg}"
  21. Grid.Column="0"/>
  22. <TextBox Name="TextBox"
  23. Grid.Column="1"
  24. Watermark="{Binding $parent[components:SearchBar].PlaceholderText}"
  25. Text="{Binding $parent[components:SearchBar].Text}"
  26. TextChanged="TextBox_TextChanged"
  27. VerticalAlignment="Center"
  28. VerticalContentAlignment="Center"
  29. Background="Transparent"
  30. Margin="0"
  31. BorderBrush="Transparent"
  32. BorderThickness="0">
  33. </TextBox>
  34. </Grid>
  35. </Border>
  36. </UserControl>