HotelPage.xaml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <Page x:Class="practica12.Pages.HotelPage"
  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:practica12.Pages"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800"
  9. Title="HotelPage">
  10. <Grid>
  11. <StackPanel>
  12. <StackPanel>
  13. <StackPanel>
  14. <TextBlock Text="Отели" FontSize="28" Style="{StaticResource TBStyle}"/>
  15. </StackPanel>
  16. <DataGrid Name="dgHotels" AutoGenerateColumns="False" Height="450" CanUserAddRows="False" FontSize="16" FontFamily="Comic Sans MS" Margin="0,0,0,5">
  17. <DataGrid.Columns>
  18. <DataGridTextColumn Header="Название" Width="*" Binding="{Binding Name}"/>
  19. <DataGridTextColumn Header="Кол-во звезд" Width="*" Binding="{Binding CountOfStars}"/>
  20. <DataGridTextColumn Header="Страна" Width="*" Binding="{Binding Country.Name}"/>
  21. <DataGridTextColumn Header="Кол-во туров" Width="*" Binding="{Binding CountTours}"/>
  22. <DataGridTemplateColumn Width="*">
  23. <DataGridTemplateColumn.CellTemplate>
  24. <DataTemplate>
  25. <Button Name="btnUpdate" Uid="{Binding Id}" Click="btnUpdate_Click" HorizontalAlignment="Center" FontSize="14" Style="{StaticResource btnstyle1}" Content="Редактировать"/>
  26. </DataTemplate>
  27. </DataGridTemplateColumn.CellTemplate>
  28. </DataGridTemplateColumn>
  29. </DataGrid.Columns>
  30. </DataGrid>
  31. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  32. <Button Name="btn_Tours" Content="Туры" Click="btn_Tours_Click" Style="{StaticResource btnstyle1}" />
  33. <Button Name="btn_Add" Content="Добавить" Click="btn_Add_Click" Style="{StaticResource btnstyle1}" />
  34. <Button Name="btn_Dell" Content="Удалить" Click="btn_Dell_Click" Style="{StaticResource btnstyle1}" />
  35. </StackPanel>
  36. </StackPanel>
  37. <StackPanel>
  38. <!--Меню с номерами страниц-->
  39. <StackPanel>
  40. <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
  41. <GroupBox Header="Введите количество записей на одной странице">
  42. <TextBox Name="txtPageCount" TextChanged="txtPageCount_TextChanged"/>
  43. </GroupBox>
  44. <TextBlock Name="txtPrev" Uid="prev" Text=" &lt; " MouseDown="GoPage_MouseDown"/>
  45. <TextBlock Name="txt1" Uid="1" Text="{Binding Path = NPage[0]}" Visibility="{Binding Visible[0]}" FontWeight="{Binding Bold[0]}" MouseDown="GoPage_MouseDown"/>
  46. <TextBlock Name="txt2" Uid="2" Text="{Binding Path = NPage[1]}" Visibility="{Binding Visible[1]}" FontWeight="{Binding Bold[1]}" MouseDown="GoPage_MouseDown"/>
  47. <TextBlock Name="txt3" Uid="3" Text="{Binding Path = NPage[2]}" Visibility="{Binding Visible[2]}" FontWeight="{Binding Bold[2]}" MouseDown="GoPage_MouseDown"/>
  48. <TextBlock Name="txt4" Uid="4" Text="{Binding Path = NPage[3]}" Visibility="{Binding Visible[3]}" FontWeight="{Binding Bold[3]}" MouseDown="GoPage_MouseDown"/>
  49. <TextBlock Name="txt5" Uid="5" Text="{Binding Path = NPage[4]}" Visibility="{Binding Visible[4]}" FontWeight="{Binding Bold[4]}" MouseDown="GoPage_MouseDown"/>
  50. <TextBlock Name="txtNext" Uid="next" Text=" &gt;" MouseDown="GoPage_MouseDown"/>
  51. </StackPanel>
  52. </StackPanel>
  53. </StackPanel>
  54. </StackPanel>
  55. </Grid>
  56. </Page>