<?xml version="1.0" encoding="utf-8" ?>
<local:WebDavPlayerPageControlBase
    x:Class="BiliCopilot.UI.Controls.WebDav.WebDavPlayerMainHeader"
    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:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:ext="using:BiliCopilot.UI.Extensions"
    xmlns:ic="using:FluentIcons.WinUI"
    xmlns:local="using:BiliCopilot.UI.Controls.WebDav"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Padding="16,0">
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <base:TrimTextBlock
            Margin="0,0,12,0"
            HorizontalAlignment="Left"
            VerticalAlignment="Center"
            FontWeight="Bold"
            MaxLines="1"
            Text="{x:Bind ViewModel.Title, Mode=OneWay}" />
        <StackPanel
            Grid.Column="1"
            VerticalAlignment="Center"
            Orientation="Horizontal"
            Spacing="4">
            <Button Style="{StaticResource IconButtonStyle}">
                <ic:SymbolIcon FontSize="14" Symbol="Share" />
                <Button.Flyout>
                    <MenuFlyout Placement="Bottom">
                        <MenuFlyoutSeparator Style="{StaticResource MenuFlyoutHeaderSeparatorStyle}" Tag="{ext:Locale Name=Link}" />
                        <MenuFlyoutItem
                            MinWidth="200"
                            Command="{x:Bind ViewModel.CopyVideoUrlCommand, Mode=OneWay}"
                            Text="{ext:Locale Name=CopyVideoUrl}" />
                        <MenuFlyoutItem Command="{x:Bind ViewModel.ShareVideoUrlCommand, Mode=OneWay}" Text="{ext:Locale Name=ShareLink}" />
                        <MenuFlyoutSeparator />
                        <MenuFlyoutSeparator Style="{StaticResource MenuFlyoutHeaderSeparatorStyle}" Tag="{ext:Locale Name=OpenWith}" />
                        <MenuFlyoutItem Command="{x:Bind ViewModel.OpenInNewWindowCommand, Mode=OneWay}" Text="{ext:Locale Name=OpenInNewWindow}" />
                        <MenuFlyoutItem Command="{x:Bind ViewModel.Player.OpenWithMpvCommand, Mode=OneWay}" Text="{ext:Locale Name=OpenWithMpv}" />
                        <MenuFlyoutItem Command="{x:Bind ViewModel.Player.OpenWithMpvNetCommand, Mode=OneWay}" Text="{ext:Locale Name=OpenWithMpvNet}" />
                    </MenuFlyout>
                </Button.Flyout>
            </Button>
            <base:SideSplitButton IsHide="{x:Bind ViewModel.IsNavColumnManualHide, Mode=TwoWay}" IsInvertDirection="True" />
        </StackPanel>
    </Grid>
</local:WebDavPlayerPageControlBase>
