<UserControl x:Class="Apollon.WPF.Views.Components.OverViewListing"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
             
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <Grid>        
        <Border BorderBrush="#0000a0"
                BorderThickness="1"
                CornerRadius="10"
                >
            <ListView FontSize="16"
                      Foreground="#0000a0"
                      FontWeight="Bold"
                      Background="Transparent"
                      BorderBrush="Transparent"
                      Padding="5"
                      ItemsSource="{Binding OverviewListingItemViewModels}"
                      SelectedItem="{Binding SelectedOverviewListingItemViewModel}"
                      ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                      SelectionMode="Single">
                <ListView.ItemContainerStyle>
                    <Style TargetType="ListViewItem">
                        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                    </Style>
                </ListView.ItemContainerStyle>
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                                <ColumnDefinition Width="auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <WrapPanel Grid.Column="0">
                                <TextBlock Text="{Binding TournamentName}"
                                           Margin="0 0 4 0"/>
                                <TextBlock Text="{Binding Location}"/>
                            </WrapPanel>
                            <WrapPanel Grid.Column="1">
                                <Button 
                                    Background="Transparent"
                                    BorderThickness="0"
                                    Cursor="Hand"
                                    ToolTip="Löschen"
                                    Command="{Binding EditCommand}">
                                    <iconPacks:PackIconMaterial Kind="Pencil"
                                                        VerticalAlignment="Center"
                                                        HorizontalAlignment="Center"
                                                        Grid.Column="1"
                                                        Foreground="#0000a0"
                                                        Margin="4"/>
                                </Button>
                                <Button Grid.Column="1"
                                    Background="Transparent"
                                    BorderThickness="0"
                                    Cursor="Hand"
                                    ToolTip="Löschen"
                                    Command="{Binding WarningDeleteCommand}">
                                    <iconPacks:PackIconMaterial Kind="TrashCan"
                                                        VerticalAlignment="Center"
                                                        HorizontalAlignment="Center"
                                                        Grid.Column="1"
                                                        Foreground="Red"/>
                                </Button>
                            </WrapPanel>   
                        </Grid>                        
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
        </Border>       
    </Grid>
</UserControl>
