<ui:Page
    x:Class="ModernWpf.SampleApp.ControlPages.AutoSuggestBoxPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:ui="http://schemas.modernwpf.com/2019"
    xmlns:sc="clr-namespace:SamplesCommon;assembly=SamplesCommon"
    mc:Ignorable="d">

    <ScrollViewer>
        <ui:SimpleStackPanel Margin="{StaticResource ControlPageContentMargin}">
            <sc:ControlExample
                x:Name="Example1"
                HeaderText="A basic autosuggest box.">
                <StackPanel Orientation="Horizontal">
                    <ui:AutoSuggestBox
                        x:Name="Control1"
                        TextChanged="AutoSuggestBox_TextChanged"
                        SuggestionChosen="AutoSuggestBox_SuggestionChosen"
                        QuerySubmitted="AutoSuggestBox_QuerySubmitted"
                        Width="300"
                        AutomationProperties.Name="Basic AutoSuggestBox" />
                    <TextBlock
                        x:Name="SuggestionOutput"
                        Style="{StaticResource OutputTextBlockStyle}" />
                </StackPanel>
                <sc:ControlExample.Options>
                    <ui:SimpleStackPanel Style="{StaticResource OptionsPanelStyle}">
                        <CheckBox
                            Content="UpdateTextOnSelect"
                            IsChecked="{Binding ElementName=Control1, Path=UpdateTextOnSelect}" />
                    </ui:SimpleStackPanel>
                </sc:ControlExample.Options>
            </sc:ControlExample>
            <sc:ControlExample
                x:Name="Example2"
                HeaderText="An AutoSuggestBox that provides a SearchBox experience">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <ui:AutoSuggestBox
                        x:Name="Control2"
                        PlaceholderText="Type a control name"
                        TextChanged="Control2_TextChanged"
                        QueryIcon="Find"
                        QuerySubmitted="Control2_QuerySubmitted"
                        SuggestionChosen="Control2_SuggestionChosen"
                        Width="300"
                        HorizontalAlignment="Left" />
                    <StackPanel
                        x:Name="ControlDetails"
                        Grid.Row="1"
                        HorizontalAlignment="Left"
                        Visibility="Collapsed"
                        Margin="0,8,0,0">
                        <TextBlock
                            x:Name="ControlTitle"
                            Style="{StaticResource BaseTextBlockStyle}" />
                        <ui:HyperlinkButton x:Name="ControlLink" Click="ControlLink_Click" />
                    </StackPanel>
                </Grid>
            </sc:ControlExample>
        </ui:SimpleStackPanel>
    </ScrollViewer>
</ui:Page>
