<Window x:Class="WD7UVN_SzTGUI_2023242.Client.WPF.MainWindow"
        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:WD7UVN_SzTGUI_2023242.Client.WPF.ViewModels"
        mc:Ignorable="d"
        Title="Company database manager" Height="450" Width="900">

    <Window.DataContext>
        <local:MainWindowViewModel/>
    </Window.DataContext>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        
        <Grid Grid.Column="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="1*" />
                <RowDefinition Height="7*" />
                <RowDefinition Height="2*" />
            </Grid.RowDefinitions>

            <Label Grid.Row="0" Content="Services" FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center"/>

            <ListBox Grid.Row="1" ItemsSource="{Binding Services}" SelectedItem="{Binding SelectedService}">
                <ListBox.ItemContainerStyle>
                    <Style TargetType="ListBoxItem">
                        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                        <Setter Property="VerticalContentAlignment" Value="Stretch" />
                        <Setter Property="Padding" Value="0" />
                        <Setter Property="Margin" Value="0" />
                    </Style>
                </ListBox.ItemContainerStyle>
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Label Content="{Binding NAME}"/>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>

            <UniformGrid Grid.Row="2" Rows="3">
                <Button Content="Delete selected" Command="{Binding DeleteServiceCommand}"></Button>
                <Button Content="Create new" Click="CreateNewService"></Button>
                <Button Content="Expand all" Click="ExpandAllServices"/>
            </UniformGrid>
        </Grid>

        <Grid Grid.Column="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="1*" />
                <RowDefinition Height="7*" />
                <RowDefinition Height="2*" />
            </Grid.RowDefinitions>

            <Label Grid.Row="0" Content="Customers" FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center"/>

            <ListBox Grid.Row="1" ItemsSource="{Binding Customers}" SelectedItem="{Binding SelectedCustomer}">
                <ListBox.ItemContainerStyle>
                    <Style TargetType="ListBoxItem">
                        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                        <Setter Property="VerticalContentAlignment" Value="Stretch" />
                        <Setter Property="Padding" Value="0" />
                        <Setter Property="Margin" Value="0" />
                    </Style>
                </ListBox.ItemContainerStyle>
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Label Content="{Binding NAME}"/>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>

            <UniformGrid Grid.Row="2" Rows="3">
                <Button Content="Delete selected" Command="{Binding DeleteCustomerCommand}"></Button>
                <Button Content="Create new" Click="CreateNewCustomer"></Button>
                <Button Content="Expand all" Click="ExpandAllCustomers"/>
            </UniformGrid>
        </Grid>

        <Grid Grid.Column="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="1*" />
                <RowDefinition Height="7*" />
                <RowDefinition Height="2*" />
            </Grid.RowDefinitions>

            <Label Grid.Row="0" Content="Teams" FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center"/>

            <ListBox Grid.Row="1" ItemsSource="{Binding MaintainerTeams}" SelectedItem="{Binding SelectedMaintainerTeam}">
                <ListBox.ItemContainerStyle>
                    <Style TargetType="ListBoxItem">
                        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                        <Setter Property="VerticalContentAlignment" Value="Stretch" />
                        <Setter Property="Padding" Value="0" />
                        <Setter Property="Margin" Value="0" />
                    </Style>
                </ListBox.ItemContainerStyle>
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Label Content="{Binding NAME}"/>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>

            <UniformGrid Grid.Row="2" Rows="3">
                <Button Content="Delete selected" Command="{Binding DeleteMaintainerTeamCommand}"></Button>
                <Button Content="Create new" Click="CreateNewMaintainerTeam"></Button>
                <Button Content="Expand all" Click="ExpandAllMaintainerTeams"/>
            </UniformGrid>
        </Grid>

        <Grid Grid.Column="3">
            <Grid.RowDefinitions>
                <RowDefinition Height="1*" />
                <RowDefinition Height="7*" />
                <RowDefinition Height="2*" />
            </Grid.RowDefinitions>

            <Label Grid.Row="0" Content="Employees" FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center"/>

            <ListBox Grid.Row="1" ItemsSource="{Binding Employees}" SelectedItem="{Binding SelectedEmployee}">
                <ListBox.ItemContainerStyle>
                    <Style TargetType="ListBoxItem">
                        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                        <Setter Property="VerticalContentAlignment" Value="Stretch" />
                        <Setter Property="Padding" Value="0" />
                        <Setter Property="Margin" Value="0" />
                    </Style>
                </ListBox.ItemContainerStyle>
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Label Content="{Binding NAME}"/>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>

            <UniformGrid Grid.Row="2" Rows="3">
                <Button Content="Delete selected" Command="{Binding DeleteEmployeeCommand}"></Button>
                <Button Content="Create new" Click="CreateNewEmployee"></Button>
                <Button Content="Expand all" Click="ExpandAllEmployees"/>
            </UniformGrid>
        </Grid>
    </Grid>
</Window>
