MobileSearchBar.xaml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <ContentView xmlns="http://xamarin.com/schemas/2014/forms"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
  4. xmlns:local="clr-namespace:InABox.Mobile"
  5. x:Class="InABox.Mobile.MobileSearchBar"
  6. BackgroundColor="Transparent">
  7. <ContentView.ControlTemplate>
  8. <ControlTemplate x:DataType="local:MobileSearchBar">
  9. <Grid BackgroundColor="Transparent" Margin="0">
  10. <local:MobileCard
  11. Padding="1,1,2,1"
  12. BackgroundColor="{TemplateBinding TextBackgroundColor}"
  13. BorderColor="{TemplateBinding BorderColor}"
  14. IsClippedToBounds="True"
  15. HeightRequest="40">
  16. <Grid
  17. HorizontalOptions="Fill"
  18. BackgroundColor="Transparent"
  19. ColumnSpacing="0">
  20. <Grid.ColumnDefinitions>
  21. <ColumnDefinition Width="Auto"/>
  22. <ColumnDefinition Width="*" />
  23. </Grid.ColumnDefinitions>
  24. <Image
  25. Source="search"
  26. BackgroundColor="{TemplateBinding BackgroundColor}"
  27. Grid.Column="0"
  28. HeightRequest="25"
  29. WidthRequest="25"
  30. Margin="5"
  31. VerticalOptions="Center"
  32. HorizontalOptions="Center"
  33. />
  34. <local:MobileEntry
  35. x:Name="_search"
  36. Grid.Column="1"
  37. HorizontalOptions="Fill"
  38. PlaceholderColor="Gray"
  39. VerticalOptions="Fill"
  40. TextChanged="_search_OnTextChanged"
  41. BackgroundColor="{TemplateBinding TextBackgroundColor}"
  42. TextColor="{TemplateBinding TextColor}"
  43. Placeholder="{Binding PlaceHolder}"
  44. Margin="0"
  45. Keyboard="Plain" VerticalTextAlignment="Center"
  46. />
  47. </Grid>
  48. </local:MobileCard>
  49. </Grid>
  50. </ControlTemplate>
  51. </ContentView.ControlTemplate>
  52. </ContentView>