<?xml version="1.0" encoding="utf-8" ?>
<local:PgcPlayerPageControlBase
    x:Class="BiliCopilot.UI.Controls.Player.PgcPlayerSideBody"
    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="EpisodeTemplate" x:DataType="components:PgcPlayerEpisodeSectionDetailViewModel">
            <local:PgcEpisodesSection ViewModel="{x:Bind}" />
        </DataTemplate>
        <DataTemplate x:Key="SeasonTemplate" x:DataType="components:PgcPlayerSeasonSectionDetailViewModel">
            <local:PgcSeasonsSection ViewModel="{x:Bind}" />
        </DataTemplate>
        <DataTemplate x:Key="InfoTemplate" x:DataType="components:PgcPlayerInfoSectionDetailViewModel">
            <local:PgcInfoSection ViewModel="{x:Bind Page}" />
        </DataTemplate>
        <extensions:PlayerSectionTemplateSelector
            x:Key="Selector"
            CommentTemplate="{StaticResource CommentTemplate}"
            EpisodeTemplate="{StaticResource EpisodeTemplate}"
            InfoTemplate="{StaticResource InfoTemplate}"
            SeasonTemplate="{StaticResource SeasonTemplate}" />
    </UserControl.Resources>

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