<local:SearchComponent
    x:Class="Bili.App.Controls.SearchLiveView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:behaviors="using:Bili.App.Behaviors"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
    xmlns:live="using:Bili.ViewModels.Interfaces.Live"
    xmlns:live1="using:Bili.App.Controls.Live"
    xmlns:local="using:Bili.App.Controls"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    d:DesignHeight="300"
    d:DesignWidth="400"
    mc:Ignorable="d">

    <ScrollViewer
        Padding="{x:Bind CoreViewModel.PageHorizontalPadding, Converter={StaticResource HorizontalThicknessConverter}, Mode=OneWay}"
        HorizontalScrollMode="Disabled"
        VerticalScrollBarVisibility="Auto">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="LayoutGroup">
                <VisualState x:Name="WideState">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowWidth="{StaticResource MediumWindowThresholdWidth}" />
                    </VisualState.StateTriggers>
                </VisualState>
                <VisualState x:Name="NarrowState">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowWidth="0" />
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="LiveView.ItemOrientation" Value="Horizontal" />
                    </VisualState.Setters>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <local:VerticalRepeaterView
            x:Name="LiveView"
            HeaderVisibility="Collapsed"
            ItemsSource="{x:Bind ItemsSource, Mode=OneWay}"
            MinWideItemHeight="220"
            MinWideItemWidth="200">
            <interactivity:Interaction.Behaviors>
                <behaviors:IncrementalBehavior />
            </interactivity:Interaction.Behaviors>
            <local:VerticalRepeaterView.ItemTemplate>
                <DataTemplate x:DataType="live:ILiveItemViewModel">
                    <live1:LiveItem ViewModel="{x:Bind}" />
                </DataTemplate>
            </local:VerticalRepeaterView.ItemTemplate>
        </local:VerticalRepeaterView>
    </ScrollViewer>
</local:SearchComponent>
