<?xml version="1.0" encoding="utf-8" ?>
<UserControl
    x:Class="BetterLyrics.WinUI3.Controls.LyricsWindowSwitchControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:CommunityToolkit.WinUI.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:uc="using:BetterLyrics.WinUI3.Controls"
    xmlns:ui="using:CommunityToolkit.WinUI"
    mc:Ignorable="d">

    <Grid
        HorizontalAlignment="Center"
        VerticalAlignment="Center"
        Background="{ThemeResource AcrylicInAppFillColorDefaultBrush}"
        CornerRadius="12">
        <Button
            Margin="12"
            HorizontalAlignment="Right"
            VerticalAlignment="Top"
            Click="Button_Click"
            Content="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
                                  Glyph=&#xE653;}"
            Style="{StaticResource GhostButtonStyle}" />
        <ListView
            Margin="48"
            ItemsSource="{x:Bind ViewModel.AppSettings.WindowBoundsRecords, Mode=OneWay}"
            SelectedItem="{x:Bind ViewModel.LiveStates.LyricsWindowStatus, Mode=TwoWay}">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <controls:WrapPanel HorizontalSpacing="0" VerticalSpacing="0" />
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ListView.ItemTemplate>
                <DataTemplate>
                    <Grid
                        Margin="0,10"
                        Padding="5"
                        AllowFocusOnInteraction="True"
                        CornerRadius="4"
                        Tapped="Grid_Tapped">
                        <uc:DemoWindowGrid LyricsWindowStatus="{Binding}" />
                    </Grid>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
    </Grid>
</UserControl>
