AutoCompleteBoxPage.xaml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <UserControl x:Class="ControlCatalog.Pages.AutoCompleteBoxPage"
  2. xmlns="https://github.com/avaloniaui"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:sys="clr-namespace:System;assembly=netstandard"
  7. d:DesignHeight="600"
  8. d:DesignWidth="400">
  9. <StackPanel Orientation="Vertical"
  10. Spacing="4"
  11. MaxWidth="660">
  12. <TextBlock Classes="h2">A control into which the user can input text</TextBlock>
  13. <UniformGrid Margin="-8,0"
  14. Columns="2">
  15. <UniformGrid.Styles>
  16. <Style Selector="StackPanel">
  17. <Setter Property="Margin" Value="8" />
  18. </Style>
  19. </UniformGrid.Styles>
  20. <StackPanel>
  21. <TextBlock Text="MinimumPrefixLength: 1" />
  22. <AutoCompleteBox MinimumPrefixLength="1" />
  23. </StackPanel>
  24. <StackPanel>
  25. <TextBlock Text="MinimumPrefixLength: 3" />
  26. <AutoCompleteBox MinimumPrefixLength="3" />
  27. </StackPanel>
  28. <StackPanel>
  29. <TextBlock Text="MinimumPopulateDelay: 1s" />
  30. <AutoCompleteBox MinimumPopulateDelay="00:00:01" />
  31. </StackPanel>
  32. <StackPanel>
  33. <TextBlock Text="MaxDropDownHeight: 60" />
  34. <AutoCompleteBox MaxDropDownHeight="60" />
  35. </StackPanel>
  36. <StackPanel>
  37. <TextBlock Text="Watermark" />
  38. <AutoCompleteBox Watermark="Hello World" />
  39. </StackPanel>
  40. <StackPanel>
  41. <TextBlock Text="Disabled" />
  42. <AutoCompleteBox IsEnabled="False" />
  43. </StackPanel>
  44. <StackPanel>
  45. <TextBlock Text="ValueMemberBinding" />
  46. <AutoCompleteBox ValueMemberBinding="{Binding Capital}" />
  47. </StackPanel>
  48. <StackPanel>
  49. <TextBlock Text="Multi-Binding" />
  50. <AutoCompleteBox Name="MultiBindingBox" FilterMode="Contains" />
  51. </StackPanel>
  52. <StackPanel>
  53. <TextBlock Text="Async Populate" />
  54. <AutoCompleteBox Name="AsyncBox" FilterMode="None" />
  55. </StackPanel>
  56. <StackPanel>
  57. <TextBlock Text="Custom Autocomplete" />
  58. <AutoCompleteBox Name="CustomAutocompleteBox" FilterMode="None" />
  59. </StackPanel>
  60. </UniformGrid>
  61. <StackPanel>
  62. <TextBlock Text="With Validation Errors" />
  63. <AutoCompleteBox Name="ValidationErrors" FilterMode="None">
  64. <DataValidationErrors.Error>
  65. <sys:Exception />
  66. </DataValidationErrors.Error>
  67. </AutoCompleteBox>
  68. </StackPanel>
  69. </StackPanel>
  70. </UserControl>