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

    <UserControl.Resources>
        <DataTemplate x:Key="NotifyTemplate" x:DataType="components:NotifyMessageSectionDetailViewModel">
            <local:NotifyMessageHeader ViewModel="{x:Bind}" />
        </DataTemplate>
        <DataTemplate x:Key="ChatTemplate" x:DataType="components:ChatMessageSectionDetailViewModel">
            <local:ChatMessageHeader ViewModel="{x:Bind}" />
        </DataTemplate>
        <ext:MessageSectionTemplateSelector
            x:Key="Selector"
            ChatTemplate="{StaticResource ChatTemplate}"
            NotifyTemplate="{StaticResource NotifyTemplate}" />
    </UserControl.Resources>

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