<Window x:Class="Ink_Canvas.ManagePickNameBackgroundsWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
        xmlns:local="clr-namespace:Ink_Canvas"
        mc:Ignorable="d"
        Title="管理点名背景" Height="500" Width="750" WindowStartupLocation="CenterScreen">
    <Grid Margin="20">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        
        <TextBlock Text="管理自定义点名背景" FontSize="20" FontWeight="Bold" Margin="0,0,0,15"/>
        
        <ListView Grid.Row="1" Name="BackgroundsListView" BorderBrush="#CCCCCC" BorderThickness="1">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="预览" Width="150">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Border BorderThickness="1" BorderBrush="#CCCCCC">
                                    <Image Source="{Binding FilePath}" Width="140" Height="80" Stretch="Uniform"/>
                                </Border>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Header="名称" Width="300" DisplayMemberBinding="{Binding Name}"/>
                    <GridViewColumn Header="操作" Width="200">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <Button Content="设为当前" Width="90" Margin="0,0,5,0" Click="SetAsCurrentButton_Click" Tag="{Binding}"/>
                                    <Button Content="删除" Width="70" Click="DeleteBackgroundButton_Click" Tag="{Binding}"/>
                                </StackPanel>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>
        
        <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,15,0,0">
            <Button Content="关闭" Width="120" Height="40" Click="CloseButton_Click"/>
        </StackPanel>
    </Grid>
</Window> 