<local:SearchSuggestBoxBase
    x:Class="Bili.Workspace.Controls.Community.SearchSuggestBox"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:ext="using:Bili.Workspace.Resources.Extension"
    xmlns:local="using:Bili.Workspace.Controls.Community"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:search="using:Bili.Models.Data.Search"
    d:DesignHeight="300"
    d:DesignWidth="400"
    TabFocusNavigation="Local"
    mc:Ignorable="d">

    <Grid>
        <AutoSuggestBox
            x:Name="AppSearchBox"
            HorizontalAlignment="Stretch"
            IsTabStop="True"
            ItemsSource="{x:Bind ViewModel.SearchSuggestion, Mode=OneWay}"
            PlaceholderText="{ext:Locale Name=SearchTip}"
            QueryIcon="Find"
            QuerySubmitted="OnSearchBoxSubmitted"
            TabIndex="2"
            Text="{x:Bind ViewModel.Keyword, Mode=TwoWay}"
            UpdateTextOnSelect="False"
            XYFocusLeftNavigationStrategy="Auto">
            <AutoSuggestBox.ItemTemplate>
                <DataTemplate x:DataType="search:SearchSuggest">
                    <TextBlock Text="{x:Bind DisplayText}" TextTrimming="CharacterEllipsis" />
                </DataTemplate>
            </AutoSuggestBox.ItemTemplate>
        </AutoSuggestBox>
    </Grid>
</local:SearchSuggestBoxBase>
