MainPage.xaml 4.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <Page x:Class="practica12.Pages.MainPage"
  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="574" d:DesignWidth="950"
  9. Title="MainPage">
  10. <Page.Resources>
  11. <BitmapImage x:Key="defaultImage" UriSource="/Resourse/NoPhoto.png"/>
  12. </Page.Resources>
  13. <Grid>
  14. <StackPanel Height="574" VerticalAlignment="Bottom">
  15. <TextBlock Text="Туры" FontSize="28" Margin="0,0,0,10" Style="{StaticResource TBStyle}" />
  16. <StackPanel Orientation="Horizontal" Margin="5" HorizontalAlignment="Center">
  17. <TextBlock Text="Введите текс для поиска:" FontSize="20" Margin="5" Style="{StaticResource TBStyle}"/>
  18. <TextBox Name="Search" TextChanged="Search_TextChanged" Height="20" Width="300" />
  19. </StackPanel>
  20. <StackPanel Orientation="Horizontal" Margin="105,0,0,0" HorizontalAlignment="Center">
  21. <TextBlock Text="Выберите тип:" FontSize="20" Margin="5" Style="{StaticResource TBStyle}"/>
  22. <ComboBox x:Name="ComboBox1" SelectionChanged="ComboBox1_SelectionChanged" Height="20" Width="300" >
  23. </ComboBox>
  24. </StackPanel>
  25. <StackPanel Orientation="Horizontal" Margin="35,0,0,0" HorizontalAlignment="Center">
  26. <TextBlock Margin="5" FontSize="20" Text="Критерий сортировки" Style="{StaticResource TBStyle}"/>
  27. <StackPanel Height="36" Width="305" Orientation="Horizontal">
  28. <ComboBox x:Name="Sort" SelectionChanged="Sort_SelectionChanged" Height="20" Width="300" >
  29. <ComboBoxItem>Без сотрировки</ComboBoxItem>
  30. <ComboBoxItem>По возрастанию</ComboBoxItem>
  31. <ComboBoxItem>По убыванию</ComboBoxItem>
  32. </ComboBox>
  33. </StackPanel>
  34. </StackPanel>
  35. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  36. <CheckBox Name="cbActual" Content="Только актуальные туры" FontSize="14" Checked="cbActual_Checked" Foreground="#445c93" Unchecked="cbActual_Checked" HorizontalAlignment="Center"/>
  37. <TextBlock Name="tbTotalCostOfTours" FontSize="20" Foreground="#445c93" Margin="300,0,0,0" HorizontalAlignment="Right"/>
  38. </StackPanel>
  39. <StackPanel>
  40. <ListView x:Name="lvListTour" Margin="10" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Height="312">
  41. <ListView.ItemsPanel>
  42. <ItemsPanelTemplate>
  43. <WrapPanel HorizontalAlignment="Center"></WrapPanel>
  44. </ItemsPanelTemplate>
  45. </ListView.ItemsPanel>
  46. <ListView.ItemTemplate>
  47. <DataTemplate>
  48. <Border Padding="10" CornerRadius="20" BorderThickness="1" BorderBrush="#445c93">
  49. <Grid Width="400" Height="400">
  50. <StackPanel>
  51. <TextBlock Text="{Binding Name}" HorizontalAlignment="Center" FontSize="24" Margin="10" TextWrapping="Wrap" TextAlignment="Center"/>
  52. <Image Width="400" Height="220" Source="{Binding ImagePreview, TargetNullValue={StaticResource defaultImage}}"/>
  53. <TextBlock Text="{Binding Price, StringFormat={}{0:F3} РУБ}" HorizontalAlignment="Center" FontSize="28" FontWeight="Bold" Margin="0,10,0,0"/>
  54. <Grid Margin="0,20,0,0">
  55. <TextBlock Text="{Binding TicketCount, StringFormat={}Билетов: {0}}" HorizontalAlignment="Center" Margin="0, 0, 10, 0"/>
  56. </Grid>
  57. </StackPanel>
  58. </Grid>
  59. </Border>
  60. </DataTemplate>
  61. </ListView.ItemTemplate>
  62. </ListView>
  63. </StackPanel>
  64. <Button Name="btn_hotel" Content="Отели" Click="btn_hotel_Click" Style="{StaticResource btnstyle1}" />
  65. </StackPanel>
  66. </Grid>
  67. </Page>