<UserControl
    x:Class="Bili.App.Controls.Community.CommentRepeater"
    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:community="using:Bili.ViewModels.Interfaces.Community"
    xmlns:controls="using:Bili.App.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
    xmlns:local="using:Bili.App.Controls.Community"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    d:DesignHeight="300"
    d:DesignWidth="400"
    mc:Ignorable="d">

    <ScrollViewer
        x:Name="ContentScrollViewer"
        Margin="-16,0"
        HorizontalScrollMode="Disabled"
        VerticalScrollBarVisibility="Auto">
        <StackPanel>
            <local:CommentItem
                Margin="16,0,16,8"
                ViewModel="{x:Bind TopComment, Mode=OneWay}"
                Visibility="{x:Bind TopComment, Mode=OneWay, Converter={StaticResource ObjectToVisibilityConverter}}" />
            <controls:VerticalRepeaterView
                Margin="16,0,16,12"
                HeaderVisibility="Collapsed"
                ItemOrientation="Horizontal"
                ItemsSource="{x:Bind ItemsSource, Mode=OneWay}">
                <interactivity:Interaction.Behaviors>
                    <behaviors:IncrementalBehavior />
                </interactivity:Interaction.Behaviors>
                <controls:VerticalRepeaterView.ItemTemplate>
                    <DataTemplate x:DataType="community:ICommentItemViewModel">
                        <local:CommentItem ViewModel="{x:Bind}" />
                    </DataTemplate>
                </controls:VerticalRepeaterView.ItemTemplate>
            </controls:VerticalRepeaterView>
        </StackPanel>
    </ScrollViewer>
</UserControl>
