<?xml version="1.0" encoding="utf-8" ?>
<local:VideoPlayerPageControlBase
    x:Class="BiliCopilot.UI.Controls.Player.VideoOperationControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:constants="using:BiliCopilot.UI.Models.Constants"
    xmlns:converters="using:BiliCopilot.UI.Converters"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:ext="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>
        <converters:LoopTypeConverter x:Key="LoopTypeConverter" />
    </UserControl.Resources>

    <StackPanel Spacing="20">
        <StackPanel Orientation="Horizontal" Spacing="16">
            <local:LikeButton
                Command="{x:Bind ViewModel.ToggleLikeCommand, Mode=OneWay}"
                IsLiked="{x:Bind ViewModel.IsLiked, Mode=OneWay}"
                Tip="{x:Bind ViewModel.LikeCount, Mode=OneWay, Converter={StaticResource CountConverter}}"
                TripleCommand="{x:Bind ViewModel.TripleCommand, Mode=OneWay}" />
            <local:CoinButton
                AlsoLike="{x:Bind ViewModel.IsCoinAlsoLike, Mode=TwoWay}"
                Command="{x:Bind ViewModel.CoinCommand, Mode=OneWay}"
                IsCoined="{x:Bind ViewModel.IsCoined, Mode=OneWay}"
                Tip="{x:Bind ViewModel.CoinCount, Mode=OneWay, Converter={StaticResource CountConverter}}" />
            <local:FavoriteButton
                Command="{x:Bind ViewModel.FavoriteCommand, Mode=OneWay}"
                InitializeCommand="{x:Bind ViewModel.InitializeFavoritesCommand}"
                IsFavorited="{x:Bind ViewModel.IsFavorited, Mode=OneWay}"
                ItemsSource="{x:Bind ViewModel.FavoriteFolders, Mode=OneWay}"
                Tip="{x:Bind ViewModel.FavoriteCount, Mode=OneWay, Converter={StaticResource CountConverter}}" />
        </StackPanel>
        <ComboBox
            x:Name="LoopComboBox"
            HorizontalAlignment="Stretch"
            ItemsSource="{x:Bind ViewModel.LoopTypes, Mode=OneWay}"
            SelectedItem="{x:Bind ViewModel.CurrentLoop, Mode=OneWay}"
            SelectionChanged="OnLoopSelectionChanged">
            <ComboBox.ItemTemplate>
                <DataTemplate x:DataType="constants:VideoLoopType">
                    <TextBlock Text="{x:Bind Converter={StaticResource LoopTypeConverter}}" />
                </DataTemplate>
            </ComboBox.ItemTemplate>
        </ComboBox>
        <local:DownloadButton ViewModel="{x:Bind ViewModel.Downloader, Mode=OneWay}" />
        <StackPanel Spacing="4">
            <TextBlock
                HorizontalAlignment="Left"
                FontSize="12"
                IsTextSelectionEnabled="True">
                <Run Text="AV" />
                <Run FontWeight="Bold" Text="{x:Bind ViewModel.AvId, Mode=OneWay}" />
            </TextBlock>
            <TextBlock
                HorizontalAlignment="Left"
                FontSize="12"
                IsTextSelectionEnabled="True">
                <Run Text="BV" />
                <Run FontWeight="Bold" Text="{x:Bind ViewModel.BvId, Mode=OneWay}" />
            </TextBlock>
        </StackPanel>
    </StackPanel>
</local:VideoPlayerPageControlBase>
