MainWindow.xaml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <Window x:Class="ZachPreparing.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:ZachPreparing"
  7. mc:Ignorable="d"
  8. Title="Леарн" Height="450" Width="800"
  9. Icon="Pictures/school_logo.ico"
  10. FontFamily="Comic Sans MS">
  11. <Window.Resources>
  12. <Style TargetType="ListBox">
  13. <Setter Property="ItemTemplate">
  14. <Setter.Value>
  15. <DataTemplate DataType="local:Service">
  16. <Border Padding="10"
  17. CornerRadius="10" BorderThickness="1" BorderBrush="Gray"
  18. HorizontalAlignment="Stretch">
  19. <Grid>
  20. <Grid.ColumnDefinitions>
  21. <ColumnDefinition Width="auto"/>
  22. <ColumnDefinition Width="20"/>
  23. <ColumnDefinition/>
  24. </Grid.ColumnDefinitions>
  25. <Image Height="60" Width="60"
  26. Grid.Column="0" Source="{Binding ServiceBitmapImage}"/>
  27. <Grid Grid.Column="2">
  28. <Grid.ColumnDefinitions>
  29. <ColumnDefinition Width="auto"/>
  30. <ColumnDefinition Width="auto"/>
  31. <ColumnDefinition/>
  32. </Grid.ColumnDefinitions>
  33. <Grid.RowDefinitions>
  34. <RowDefinition Height="auto"/>
  35. <RowDefinition/>
  36. <RowDefinition Height="auto"/>
  37. </Grid.RowDefinitions>
  38. <TextBlock Text="{Binding Title}"
  39. Grid.ColumnSpan="3"/>
  40. <TextBlock Text="{Binding CostWithDuration}" Grid.Row="1"
  41. Grid.ColumnSpan="3"/>
  42. <Button Grid.Column="0" Grid.Row="2"
  43. Content="редактировать"
  44. Uid="{Binding ID}"
  45. Click="Button_Red"/>
  46. <Button Grid.Column="1" Grid.Row="2"
  47. Margin="5 0 0 0"
  48. Content="удалить"
  49. Uid="{Binding ID}"
  50. Click="Button_Del"/>
  51. </Grid>
  52. </Grid>
  53. </Border>
  54. </DataTemplate>
  55. </Setter.Value>
  56. </Setter>
  57. </Style>
  58. </Window.Resources>
  59. <Grid>
  60. <Grid.ColumnDefinitions>
  61. <ColumnDefinition Width="0.25*"/>
  62. <ColumnDefinition Width="10"/>
  63. <ColumnDefinition Width="0.75*"/>
  64. </Grid.ColumnDefinitions>
  65. <Grid.RowDefinitions>
  66. <RowDefinition Height="10*"/>
  67. <RowDefinition Height="90*"/>
  68. </Grid.RowDefinitions>
  69. <Image Source="Pictures/school_logo.png" Width="60"/>
  70. <ListBox x:Name="ListViewMain"
  71. Grid.Row="1" Grid.Column="2"
  72. BorderBrush="White" d:ItemsSource="{d:SampleData ItemCount=5}">
  73. <ListBox.ItemContainerStyle>
  74. <Style TargetType="ListBoxItem">
  75. <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
  76. </Style>
  77. </ListBox.ItemContainerStyle>
  78. </ListBox>
  79. <TextBox x:Name="SearchField"
  80. Grid.Row="0" Grid.Column="2"
  81. Height="35" Width="350"
  82. MaxHeight="60" MaxWidth="450"
  83. HorizontalAlignment="Left"
  84. VerticalContentAlignment="Center"
  85. TextChanged="SearchField_TextChanged"/>
  86. <Button Grid.Column="2" Grid.Row="0"
  87. Width="150" Margin="0 0 10 0"
  88. HorizontalAlignment="Right" Height="35" Click="Button_Click">
  89. Добавить сервис
  90. </Button>
  91. <Grid Grid.Row="1">
  92. <Grid.RowDefinitions>
  93. <RowDefinition Height="auto"/>
  94. <RowDefinition Height="auto"/>
  95. <RowDefinition/>
  96. </Grid.RowDefinitions>
  97. <GroupBox Header="Фильтрация по размеру скидки" Grid.Row="0">
  98. <ComboBox Name="FiltredComboBox"
  99. SelectionChanged="FiltredComboBox_SelectionChanged">
  100. <ComboBoxItem>-</ComboBoxItem>
  101. <ComboBoxItem>от 0 до 5%</ComboBoxItem>
  102. <ComboBoxItem>от 5% до 15%</ComboBoxItem>
  103. <ComboBoxItem>от 15% до 30%</ComboBoxItem>
  104. <ComboBoxItem>от 30% до 70%</ComboBoxItem>
  105. <ComboBoxItem>от 70% до 100%</ComboBoxItem>
  106. </ComboBox>
  107. </GroupBox>
  108. <GroupBox Header="Сортировка по цене" Grid.Row="1">
  109. <ComboBox Name="SortingComboBox"
  110. SelectionChanged="SortingComboBox_SelectionChanged">
  111. <ComboBoxItem>-</ComboBoxItem>
  112. <ComboBoxItem>По возрастанию</ComboBoxItem>
  113. <ComboBoxItem>По убыванию</ComboBoxItem>
  114. </ComboBox>
  115. </GroupBox>
  116. </Grid>
  117. </Grid>
  118. </Window>