ServiceListPage.axaml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
  6. x:Class="kuzminIVProjectWorkOnDemo.ServiceListPage"
  7. xmlns:vm="using:kuzminIVProjectWorkOnDemo.ViewModels"
  8. x:DataType="vm:MainWindowViewModel">
  9. <Grid>
  10. <Grid.RowDefinitions>
  11. <RowDefinition Height="100"/>
  12. <RowDefinition Height="*"/>
  13. <RowDefinition Height="50"/>
  14. </Grid.RowDefinitions>
  15. <StackPanel Grid.Row="0">
  16. <StackPanel Orientation="Horizontal">
  17. <StackPanel>
  18. <StackPanel Orientation="Horizontal">
  19. <TextBlock Text="Сортировать по: " Classes="Default" Margin="10"/>
  20. <ComboBox Width="200" SelectedIndex="{Binding ServiceListPageWM.IndexSort}" >
  21. <ComboBoxItem Content="По возрастанию" />
  22. <ComboBoxItem Content="По убыванию" />
  23. </ComboBox>
  24. </StackPanel>
  25. <StackPanel Orientation="Horizontal" >
  26. <TextBlock Text="Скидка" Classes="Default" Margin="10"/>
  27. <ComboBox Width="200" SelectedIndex="{Binding ServiceListPageWM.Costindex}">
  28. <ComboBoxItem Content="Все"/>
  29. <ComboBoxItem Content="от 0 до 5"/>
  30. <ComboBoxItem Content="от 5 до 15"/>
  31. <ComboBoxItem Content="от 15 до 30"/>
  32. <ComboBoxItem Content="от 30 до 70"/>
  33. <ComboBoxItem Content="от 70 до 100"/>
  34. </ComboBox>
  35. </StackPanel>
  36. </StackPanel>
  37. <StackPanel >
  38. <TextBlock >
  39. Поиск по наменованию
  40. <LineBreak/>
  41. и описанию услуги
  42. </TextBlock>
  43. <TextBox Width="200" Text="{Binding ServiceListPageWM.Search}" />
  44. </StackPanel>
  45. </StackPanel>
  46. </StackPanel>
  47. <ListBox Grid.Row="1" ItemsSource="{Binding ServiceListPageWM.Services}" >
  48. <ListBox.ItemTemplate>
  49. <DataTemplate>
  50. <StackPanel Background="{Binding PriceBackround}" >
  51. <Border BorderThickness="1" CornerRadius="10" BorderBrush="Black">
  52. <StackPanel Orientation="Horizontal">
  53. <StackPanel>
  54. <Image Margin="10" Height="150" Width="150" Source="{Binding ImageBitmap}" />
  55. </StackPanel>
  56. <DockPanel>
  57. <StackPanel DockPanel.Dock="Top">
  58. <TextBlock Text="{Binding Title}"/>
  59. <StackPanel Orientation="Horizontal">
  60. <TextBlock TextDecorations="StrikeThrough" Margin="0,0,10,0" IsVisible="{Binding VisibleBlock}" Text="{Binding Cost}" />
  61. <TextBlock Text="{Binding LessonDuration}"/>
  62. </StackPanel>
  63. <TextBlock Text="{Binding DiscountStr}" IsVisible="{Binding VisibleBlock}" />
  64. </StackPanel>
  65. <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" >
  66. <Button Width="150" IsVisible="{Binding IsVisibleAdmin}" Content="Редактировать" Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).UpadateService}" CommandParameter="{Binding Id}" Classes="ButtonInTemplate" Margin="0,0,10,0" />
  67. <Button Width="150" IsVisible="{Binding IsVisibleAdmin}" Content="Удалить" Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).DeleteUser}" CommandParameter="{Binding Id}" Classes="ButtonInTemplate" Margin="10,0,0,0" />
  68. </StackPanel>
  69. </DockPanel>
  70. </StackPanel>
  71. </Border>
  72. </StackPanel>
  73. </DataTemplate>
  74. </ListBox.ItemTemplate>
  75. </ListBox>
  76. <StackPanel Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center">
  77. <TextBlock Text="{Binding ServiceListPageWM.Textcount}" />
  78. </StackPanel>
  79. <Button Content="Добавить услугу" Command="{Binding ServiceListPageWM.AddService}" IsVisible="{Binding ServiceListPageWM.AdminBool}" Grid.Row="0" Width="150" HorizontalAlignment="Right" Classes="ButtonTemplate" />
  80. <Button Content="Записать клиента на услугу" Command="{Binding ServiceListPageWM.pressButton}" IsVisible="{Binding ServiceListPageWM.AdminBool}" Grid.Row="2" Width="230" Classes="ButtonTemplate" />
  81. <Button Content="Окно администратора" IsVisible="{Binding ServiceListPageWM.AdminBool}" Grid.Row="2" Width="200" HorizontalAlignment="Right" Classes="ButtonTemplate" />
  82. </Grid>
  83. </UserControl>