pgHotels.xaml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <Page x:Class="WpfApp1.pgHotels"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:WpfApp1"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800"
  9. Title="pgHotels">
  10. <Grid>
  11. <Grid.RowDefinitions>
  12. <RowDefinition/>
  13. <RowDefinition Height="4*"/>
  14. </Grid.RowDefinitions>
  15. <StackPanel Grid.Row="0" Orientation="Horizontal">
  16. <Button Name="btnDelHotel" Click="btnDelHotel_Click" Content="Удалить отель" Width="100px" Height="50px"></Button>
  17. <Button Name="btnAddHotel" Click="btnAddHotel_Click" Content="Добавить" Width="100px" Height="50px"></Button>
  18. </StackPanel>
  19. <ScrollViewer HorizontalScrollBarVisibility="Auto" Grid.Row="1">
  20. <StackPanel>
  21. <DataGrid Name="dgHotels" AutoGenerateColumns="False" IsReadOnly="True">
  22. <DataGrid.Columns>
  23. <DataGridTextColumn Binding="{Binding Name}"></DataGridTextColumn>
  24. <DataGridTextColumn Binding="{Binding CountOfStars}"></DataGridTextColumn>
  25. <DataGridTextColumn Binding="{Binding Country.Name}"></DataGridTextColumn>
  26. <DataGridTextColumn Binding="{Binding Tour.Count}"></DataGridTextColumn>
  27. <DataGridTemplateColumn>
  28. <DataGridTemplateColumn.CellTemplate>
  29. <DataTemplate>
  30. <Button Content="Изменить" Uid="{Binding Id}" Click="Button_Click"></Button>
  31. </DataTemplate>
  32. </DataGridTemplateColumn.CellTemplate>
  33. </DataGridTemplateColumn>
  34. </DataGrid.Columns>
  35. </DataGrid>
  36. </StackPanel>
  37. </ScrollViewer>
  38. </Grid>
  39. </Page>