<UserControl xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:search="clr-namespace:Artemis.UI.Screens.Workshop.Search"
             xmlns:windowing="clr-namespace:FluentAvalonia.UI.Windowing;assembly=FluentAvalonia"
             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
             x:Class="Artemis.UI.Screens.Workshop.Search.SearchView"
             x:DataType="search:SearchViewModel">
    <UserControl.Styles>
        <StyleInclude Source="SearchViewStyles.axaml" />
    </UserControl.Styles>
    <Panel>
        <AutoCompleteBox Name="SearchBox"
                         Margin="0 5"
                         MaxWidth="500"
                         Watermark="Search"
                         MinimumPopulateDelay="0:0:0.8"
                         ValueMemberBinding="{CompiledBinding Entry.Name, DataType=search:SearchResultViewModel}"
                         AsyncPopulator="{CompiledBinding SearchAsync}"
                         SelectedItem="{CompiledBinding SelectedEntry}"
                         FilterMode="None"
                         windowing:AppWindow.AllowInteractionInTitleBar="True">
            <AutoCompleteBox.ItemTemplate>
                <DataTemplate>
                    <ContentControl Content="{Binding}" Margin="-5 0 0 0"></ContentControl>
                </DataTemplate>
            </AutoCompleteBox.ItemTemplate>
        </AutoCompleteBox>
        <ContentControl HorizontalAlignment="Right"
                        Content="{CompiledBinding DefaultTitleBarViewModel}"
                        windowing:AppWindow.AllowInteractionInTitleBar="True" />

        <Border VerticalAlignment="Top" CornerRadius="4 4 0 0" ClipToBounds="True" MaxWidth="500" Margin="0 5">
            <ProgressBar IsIndeterminate="True" VerticalAlignment="Top" IsVisible="{CompiledBinding IsLoading}"></ProgressBar>
        </Border>
    </Panel>
</UserControl>