MainWindow.xaml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <Window x:Class="WpfApp1.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:WpfApp1"
  7. mc:Ignorable="d"
  8. Title="MainWindow" Height="450" Width="800">
  9. <Grid ShowGridLines="True">
  10. <Grid.RowDefinitions>
  11. <RowDefinition Height="auto"/>
  12. <RowDefinition />
  13. <RowDefinition Height="auto"/>
  14. </Grid.RowDefinitions>
  15. <Grid.ColumnDefinitions>
  16. <ColumnDefinition Width="200"/>
  17. <ColumnDefinition/>
  18. </Grid.ColumnDefinitions>
  19. <!-- типа логотип компании -->
  20. <Image
  21. Source="/img/1.jpg"
  22. Grid.RowSpan="2" HorizontalAlignment="Right"/>
  23. <DataGrid
  24. Grid.Row="1"
  25. Grid.Column="1"
  26. CanUserAddRows="False"
  27. AutoGenerateColumns="False"
  28. ItemsSource="{Binding ClientList}">
  29. <DataGrid.Columns>
  30. <DataGridTextColumn
  31. Header="Имя"
  32. Binding="{Binding Name}"/>
  33. <DataGridTextColumn
  34. Header="Возраст"
  35. Binding="{Binding Age}"/>
  36. <DataGridTextColumn
  37. Header="Цена"
  38. Binding="{Binding Price}"/>
  39. <DataGridTextColumn
  40. Header="Место"
  41. Binding="{Binding Place}"/>
  42. <DataGridTextColumn
  43. Header="Категория"
  44. Binding="{Binding Category}"/>
  45. <DataGridTextColumn
  46. Header="Дата полета"
  47. Binding="{Binding DateFlight,StringFormat='dd.MM.yyyy'}"/>
  48. <DataGridTextColumn
  49. Header="IsActive"
  50. Binding="{Binding IsActive}"/>
  51. </DataGrid.Columns>
  52. </DataGrid>
  53. <StackPanel
  54. Orientation="Vertical"
  55. Grid.RowSpan="3"
  56. VerticalAlignment="Bottom">
  57. <Button
  58. x:Name="ExitButton"
  59. Content="Выход"
  60. Click="ExitButton_Click"
  61. Height="50"/>
  62. </StackPanel>
  63. <WrapPanel
  64. Orientation="Horizontal"
  65. Grid.Column="1"
  66. MinHeight="50">
  67. <Label
  68. Content="Искать:"
  69. VerticalAlignment="Center"/>
  70. <TextBox
  71. Width="200"
  72. VerticalAlignment="Center"
  73. x:Name="SearchFilterTextBox"
  74. KeyUp="SearchFilter_KeyUp"/>
  75. <ComboBox
  76. Name="CategoryFilterComboBox"
  77. SelectionChanged="ClientCategoryFilterComboBox_selectionChanged"
  78. VerticalAlignment="Center"
  79. MinWidth="100"
  80. SelectedIndex="0"
  81. ItemsSource="{Binding ClientCategoryList}">
  82. <ComboBox.ItemTemplate>
  83. <DataTemplate>
  84. <Label
  85. Content="{Binding title}"/>
  86. </DataTemplate>
  87. </ComboBox.ItemTemplate>
  88. </ComboBox>
  89. <Label
  90. Content="Цена:"
  91. VerticalAlignment="Center"/>
  92. <ComboBox
  93. Name="PriceFilterComboBox"
  94. SelectionChanged="ClientPriceFilterComboBox_selectionChanged"
  95. VerticalAlignment="Center"
  96. MinWidth="100"
  97. SelectedIndex="0"
  98. ItemsSource="{Binding ClientPriceList}">
  99. <ComboBox.ItemTemplate>
  100. <DataTemplate>
  101. <Label
  102. Content="{Binding title}"/>
  103. </DataTemplate>
  104. </ComboBox.ItemTemplate>
  105. </ComboBox>
  106. <Label
  107. Content="Возраст:"
  108. VerticalAlignment="Center"/>
  109. <RadioButton
  110. GroupName="Age"
  111. Tag="1"
  112. Content="Сначала взрослые"
  113. IsChecked="True"
  114. Checked="RadioButton_Checked"
  115. VerticalAlignment="Center"/>
  116. <RadioButton
  117. GroupName="Age"
  118. Tag="2"
  119. Content="Сначала дети"
  120. Checked="RadioButton_Checked"
  121. VerticalAlignment="Center"/>
  122. <!-- минимальную высоту я тут поставил, чтобы верхнюю строку сетки было видно. В реальном приложении она не нужна -->
  123. </WrapPanel>
  124. </Grid>
  125. </Window>