<?xml version="1.0" encoding="utf-8" ?>
<local:LivePartitionPageBase
    x:Class="BiliCopilot.UI.Pages.LivePartitionPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:base="using:Richasy.WinUIKernel.Share.Base"
    xmlns:components="using:BiliCopilot.UI.Controls.Components"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:ext="using:BiliCopilot.UI.Extensions"
    xmlns:livepartition="using:BiliCopilot.UI.Controls.LivePartition"
    xmlns:local="using:BiliCopilot.UI.Pages"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="56" />
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="{x:Bind ViewModel.NavColumnWidth, Mode=OneWay, Converter={StaticResource GridLengthConverter}}" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="{x:Bind ViewModel.SubNavColumnWidth, Mode=OneWay, Converter={StaticResource GridLengthConverter}}" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.ChildrenTransitions>
            <RepositionThemeTransition IsStaggeringEnabled="False" />
        </Grid.ChildrenTransitions>
        <Border
            Grid.Row="1"
            Grid.ColumnSpan="5"
            Height="1"
            HorizontalAlignment="Stretch"
            Background="{ThemeResource DividerStrokeColorDefaultBrush}" />
        <TextBlock
            Margin="16,0,-6,0"
            VerticalAlignment="Center"
            Style="{StaticResource BodyStrongTextBlockStyle}"
            Text="{ext:Locale Name=Live}"
            Visibility="{x:Bind ViewModel.IsNavColumnManualHide, Mode=OneWay, Converter={StaticResource BoolToVisibilityReverseConverter}}" />
        <TextBlock
            Grid.Column="2"
            Margin="10,0,-6,0"
            VerticalAlignment="Center"
            Style="{StaticResource BodyStrongTextBlockStyle}"
            Text="{x:Bind ViewModel.SelectedMainSection.Title, Mode=OneWay}"
            Visibility="{x:Bind ViewModel.IsSubNavEnabled, Mode=OneWay}" />
        <livepartition:LivePartitionMainSideBody
            Grid.Row="2"
            Margin="0,0,-6,0"
            Visibility="{x:Bind ViewModel.IsNavColumnManualHide, Mode=OneWay, Converter={StaticResource BoolToVisibilityReverseConverter}}" />
        <livepartition:LivePartitionSubSideBody
            Grid.Row="2"
            Grid.Column="2"
            Margin="-6,0"
            Visibility="{x:Bind ViewModel.IsSubNavEnabled, Mode=OneWay}" />
        <livepartition:LivePartitionMainHeader Grid.Column="4" Margin="-6,0,0,0" />
        <livepartition:LiveRecommendMainBody
            Grid.Row="2"
            Grid.Column="4"
            Margin="-6,0,0,0"
            Visibility="{x:Bind ViewModel.SelectedDetail, Mode=OneWay, Converter={StaticResource ObjectToVisibilityReverseConverter}}" />
        <livepartition:LiveSubPartitionMainBody
            Grid.Row="2"
            Grid.Column="4"
            Margin="-6,0,0,0"
            ViewModel="{x:Bind ViewModel.SelectedDetail, Mode=OneWay}"
            Visibility="{x:Bind ViewModel.SelectedDetail, Mode=OneWay, Converter={StaticResource ObjectToVisibilityConverter}}" />

        <!--  左侧主分栏大小控制器  -->
        <base:ColumnSplitter
            Grid.RowSpan="3"
            Grid.Column="1"
            ColumnWidth="{x:Bind ViewModel.NavColumnWidth, Mode=TwoWay}"
            HideTip="{ext:Locale Name=Show}"
            IsHide="{x:Bind ViewModel.IsNavColumnManualHide, Mode=TwoWay}"
            IsHideButtonEnabled="{x:Bind ViewModel.IsSubNavEnabled, Mode=OneWay, Converter={StaticResource ObjectToBoolReverseConverter}}"
            ShowTip="{ext:Locale Name=Hide}" />

        <!--  左侧次分栏大小控制器  -->
        <base:ColumnSplitter
            Grid.RowSpan="3"
            Grid.Column="3"
            ColumnWidth="{x:Bind ViewModel.SubNavColumnWidth, Mode=TwoWay}"
            HideTip="{ext:Locale Name=Show}"
            IsHide="{x:Bind ViewModel.IsNavColumnManualHide, Mode=TwoWay}"
            ShowTip="{ext:Locale Name=Hide}"
            Visibility="{x:Bind ViewModel.IsSubNavEnabled, Mode=OneWay}" />
    </Grid>
</local:LivePartitionPageBase>
