MobileSearchBar.xaml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. xmlns:ui="clr-namespace:XF.Material.Forms.UI;assembly=XF.Material"
  6. x:Class="InABox.Mobile.MobileSearchBar"
  7. BackgroundColor="Transparent" Padding="0" Margin="-5">
  8. <ContentView.ControlTemplate>
  9. <ControlTemplate x:DataType="local:MobileSearchBar">
  10. <ui:MaterialCard
  11. CornerRadius="5"
  12. Padding="1"
  13. Elevation="0"
  14. HasShadow="False"
  15. BackgroundColor="{TemplateBinding TextBackgroundColor}"
  16. BorderColor="{TemplateBinding BorderColor}">
  17. <Grid
  18. HorizontalOptions="Fill"
  19. BackgroundColor="Transparent"
  20. ColumnSpacing="0">
  21. <Grid.ColumnDefinitions>
  22. <ColumnDefinition Width="Auto"/>
  23. <ColumnDefinition Width="*" />
  24. </Grid.ColumnDefinitions>
  25. <Image
  26. Source="search"
  27. BackgroundColor="{TemplateBinding BackgroundColor}"
  28. Grid.Column="0"
  29. Margin="10,5,5,5"
  30. />
  31. <local:MobileEntry
  32. x:Name="_search"
  33. Grid.Column="1"
  34. HorizontalOptions="Fill"
  35. PlaceholderColor="Gray"
  36. VerticalOptions="Fill"
  37. TextChanged="_search_OnTextChanged"
  38. BackgroundColor="{TemplateBinding TextBackgroundColor}"
  39. TextColor="{TemplateBinding TextColor}"
  40. Placeholder="{Binding PlaceHolder}"
  41. Margin="10,10,10,10"
  42. Keyboard="Plain" VerticalTextAlignment="Center"
  43. />
  44. </Grid>
  45. <Frame.Margin>
  46. <OnPlatform x:TypeArguments="Thickness">
  47. <OnPlatform.Platforms>
  48. <On Platform="iOS" Value="5" />
  49. <On Platform="Android" Value="5" />
  50. </OnPlatform.Platforms>
  51. </OnPlatform>
  52. </Frame.Margin>
  53. </ui:MaterialCard>
  54. </ControlTemplate>
  55. </ContentView.ControlTemplate>
  56. </ContentView>