<Window x:Class="PACTOMETRO.EditEleccion"
        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:local="clr-namespace:PACTOMETRO"
        ResizeMode="NoResize"
        mc:Ignorable="d"
        Title="Editar Eleccion" Height="450" Width="800">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <!--COLUMNA 1-->
        <Label Grid.Column="0" Grid.Row="1" Content="Tipo" Margin="5" VerticalContentAlignment="Center"/>
        <Label Grid.Column="0" Grid.Row="2" Content="Nombre" Margin="5" VerticalContentAlignment="Center"/>
        <Label Grid.Column="0" Grid.Row="2" Content="Partidos" Margin="5,50,0,0" VerticalContentAlignment="Top" Grid.RowSpan="2"/>
        <Label Grid.Column="0" Grid.Row="5" Content="Fecha" Margin="5" VerticalContentAlignment="Center"/>
        <Button Grid.Column="0" Grid.Row="7" Margin="10" Content="Editar" Click="Editar_Eleccion"/>
        <!--COLUMNA 2-->
        <ComboBox Grid.Column="1" Grid.Row="1" Margin="15" x:Name="TipoComboBox" SelectionChanged="TipoComboBox_SelectionChanged">
            <ComboBoxItem Content="Generales"/>
            <ComboBoxItem Content="Autonómicas"/>
        </ComboBox>
        <TextBox Grid.Column="1" Grid.Row="2" x:Name="NombreEleccion" Margin="15" BorderBrush="Gray" BorderThickness="2"/>
        <ListView x:Name="partidosListView" Grid.Column="1" Grid.Row="3" Grid.RowSpan="2" Grid.ColumnSpan="2" Margin="15,0,115,0" SelectionChanged="partidosListView_SelectionChanged">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="Nombre" DisplayMemberBinding="{Binding Nombre}" />
                    <GridViewColumn Header="Escaños" DisplayMemberBinding="{Binding Escaños}" />
                    <GridViewColumn Header="Color">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <!-- Utiliza un Rectangle en lugar de simplemente mostrar el nombre del color -->
                                <Rectangle Width="40" Height="20" Fill="{Binding Color}"/>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>
        <DatePicker Name="introducirfecha" Grid.Column="1" Grid.Row="5" Margin="15" VerticalAlignment="Center" Background="White" SelectedDateFormat="Short" BorderBrush="Gray" BorderThickness="2"/>
        <Button Grid.Column="1" Grid.Row="7" Margin="10" Content="Cancelar" Click="Cancelar_Eleccion"/>
        <!--COLUMNA 3-->
        <Label Grid.Column="2" Grid.Row="0" Content="Elección" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" FontWeight="Bold" FontSize="30" />
        <Label Grid.Column="2" Grid.Row="1" Content="Lugar" VerticalContentAlignment="Center" Visibility="Hidden" x:Name="LugarL"/>
        <ComboBox Grid.Column="2" Grid.Row="1" Margin="45,15,145,15" x:Name="LugarCB" Grid.ColumnSpan="2" Visibility="Hidden">
            <ComboBoxItem Content="Andalucía"/>
            <ComboBoxItem Content="Aragón"/>
            <ComboBoxItem Content="Asturias"/>
            <ComboBoxItem Content="Islas Baleares"/>
            <ComboBoxItem Content="Islas Canarias"/>
            <ComboBoxItem Content="Cantabria"/>
            <ComboBoxItem Content="Castilla-La Mancha"/>
            <ComboBoxItem Content="Castilla y León"/>
            <ComboBoxItem Content="Cataluña"/>
            <ComboBoxItem Content="Ceuta"/>
            <ComboBoxItem Content="Comunidad de Madrid"/>
            <ComboBoxItem Content="Comunidad Valenciana"/>
            <ComboBoxItem Content="Extremadura"/>
            <ComboBoxItem Content="Galicia"/>
            <ComboBoxItem Content="La Rioja"/>
            <ComboBoxItem Content="Melilla"/>
            <ComboBoxItem Content="Región de Murcia"/>
            <ComboBoxItem Content="Navarra"/>
            <ComboBoxItem Content="País Vasco"/>
        </ComboBox>
        <!--COLUMNA 4-->
        <Label Grid.Column="3" Content="Partido" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" FontWeight="Bold" FontSize="20" Grid.ColumnSpan="2" Margin="0,54,0,54" Grid.RowSpan="3" />
        <Label Grid.Column="3" Grid.Row="2" Content="Nombre" Margin="5" VerticalContentAlignment="Center"/>
        <Label Grid.Column="3" Grid.Row="3" Content="Escaños" Margin="5" VerticalContentAlignment="Center"/>
        <Label Grid.Column="3" Grid.Row="4" Content="Color" Margin="5" VerticalContentAlignment="Center"/>
        <!--COLUMNA 5-->
        <TextBox Grid.Column="4" Grid.Row="2" x:Name="NombrePartido" Margin="15" BorderBrush="Gray" BorderThickness="2"/>
        <TextBox Grid.Column="4" Grid.Row="3" x:Name="EscañosPartido" Margin="15" BorderBrush="Gray" BorderThickness="2"/>
        <ComboBox Grid.Column="4" Grid.Row="4" x:Name="colorComboBox" Margin="15" Loaded="colorComboBox_Loaded">
            <!-- Los elementos se agregarán dinámicamente en el código C# -->
        </ComboBox>
        <Button Grid.Column="4" Grid.Row="5" Margin="10" Content="Añadir" Click="Añadir_Partido"/>
    </Grid>
</Window>
