<Page x:Class="WpfApp1.pgHotels"
      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:local="clr-namespace:WpfApp1"
      mc:Ignorable="d" 
      d:DesignHeight="450" d:DesignWidth="800"
      Title="pgHotels">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="4*"/>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" Orientation="Horizontal">
            <Button  Name="btnDelHotel" Click="btnDelHotel_Click" Content="Удалить отель" Width="100px" Height="50px"></Button>
            <Button  Name="btnAddHotel" Click="btnAddHotel_Click" Content="Добавить" Width="100px" Height="50px"></Button>
        </StackPanel>
        
        <ScrollViewer HorizontalScrollBarVisibility="Auto" Grid.Row="1">
            <StackPanel>
                <DataGrid Name="dgHotels" AutoGenerateColumns="False" IsReadOnly="True">
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Name}"></DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding CountOfStars}"></DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding Country.Name}"></DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding Tour.Count}"></DataGridTextColumn>
                        <DataGridTemplateColumn>
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Button Content="Изменить" Uid="{Binding Id}" Click="Button_Click"></Button>
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                    </DataGrid.Columns>
                </DataGrid>
            </StackPanel>
        </ScrollViewer>

    </Grid>
</Page>
