<?xml version="1.0" encoding="utf-8" ?>
<local:VideoPlayerPageControlBase
    x:Class="BiliCopilot.UI.Controls.Player.VideoPlayerSideBody"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:comment="using:BiliCopilot.UI.Controls.Comment"
    xmlns:components="using:BiliCopilot.UI.ViewModels.Components"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:extensions="using:BiliCopilot.UI.Extensions"
    xmlns:local="using:BiliCopilot.UI.Controls.Player"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <UserControl.Resources>
        <DataTemplate x:Key="CommentTemplate" x:DataType="components:CommentMainViewModel">
            <comment:CommentMainPanel ViewModel="{x:Bind}" />
        </DataTemplate>
        <DataTemplate x:Key="RecommendTemplate" x:DataType="components:VideoPlayerRecommendSectionDetailViewModel">
            <local:VideoRecommendSection ViewModel="{x:Bind}" />
        </DataTemplate>
        <DataTemplate x:Key="PartTemplate" x:DataType="components:VideoPlayerPartSectionDetailViewModel">
            <local:VideoPartsSection ViewModel="{x:Bind}" />
        </DataTemplate>
        <DataTemplate x:Key="SeasonTemplate" x:DataType="components:VideoPlayerSeasonSectionDetailViewModel">
            <local:VideoSeasonSection ViewModel="{x:Bind}" />
        </DataTemplate>
        <DataTemplate x:Key="PlaylistTemplate" x:DataType="components:VideoPlayerPlaylistSectionDetailViewModel">
            <local:VideoPlaylistSection ViewModel="{x:Bind}" />
        </DataTemplate>
        <DataTemplate x:Key="InfoTemplate" x:DataType="components:VideoPlayerInfoSectionDetailViewModel">
            <local:VideoInfoSection ViewModel="{x:Bind Page}" />
        </DataTemplate>
        <DataTemplate x:Key="AITemplate" x:DataType="components:VideoPlayerAISectionDetailViewModel">
            <local:VideoAISection ViewModel="{x:Bind AI}" />
        </DataTemplate>
        <extensions:PlayerSectionTemplateSelector
            x:Key="Selector"
            AITemplate="{StaticResource AITemplate}"
            CommentTemplate="{StaticResource CommentTemplate}"
            InfoTemplate="{StaticResource InfoTemplate}"
            PartTemplate="{StaticResource PartTemplate}"
            PlaylistTemplate="{StaticResource PlaylistTemplate}"
            RecommendTemplate="{StaticResource RecommendTemplate}"
            UgcSeasonTemplate="{StaticResource SeasonTemplate}" />
    </UserControl.Resources>

    <Grid>
        <ContentControl
            Content="{x:Bind ViewModel.SelectedSection, Mode=OneWay}"
            ContentTemplateSelector="{StaticResource Selector}"
            Style="{StaticResource AppContentControlStyle}" />
    </Grid>
</local:VideoPlayerPageControlBase>
