AllSubjectsModulesAndProgramTemplates.axaml 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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="1000" d:DesignHeight="990"
  6. x:Class="AvaloniaApplication4.Views.ActionPages.AllSubjectsModulesAndProgramTemplates"
  7. xmlns:vm="using:AvaloniaApplication4.ViewModels"
  8. x:DataType="vm:AllSubjectsModulesAndProgramTemplatesViewModel"
  9. Background="White"
  10. Padding="80">
  11. <ScrollViewer>
  12. <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="0 20 0 0">
  13. <TextBlock Margin="0 0 0 25" Text="Предметы, модули, шаблоны программ" Classes="titleStyle" FontWeight="Bold"/>
  14. <TextBlock Margin="0 0 0 20" Text="Предметы" Classes="mediumText" FontWeight="Bold"/>
  15. <Button Command="{Binding $parent[UserControl].((vm:AllSubjectsModulesAndProgramTemplatesViewModel)DataContext).AddNewSubject}" Margin="0 0 0 20" Content="Добавить новый предмет" HorizontalAlignment="Stretch"/>
  16. <ListBox ItemsSource="{Binding Subjects}" Margin="0 0 0 25">
  17. <ListBox.ItemTemplate>
  18. <DataTemplate>
  19. <Grid Margin="0 0 0 15">
  20. <Grid.ColumnDefinitions>
  21. <ColumnDefinition Width="3*"/>
  22. <ColumnDefinition Width="1*"/>
  23. </Grid.ColumnDefinitions>
  24. <TextBlock Text="{Binding NameSubject}" Classes="mediumText" TextWrapping="Wrap" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Stretch"/>
  25. <Button Content="Редактировать" Command="{Binding $parent[UserControl].((vm:AllSubjectsModulesAndProgramTemplatesViewModel)DataContext).EditSubject}" CommandParameter="{Binding IdSubject}" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Stretch"/>
  26. </Grid>
  27. </DataTemplate>
  28. </ListBox.ItemTemplate>
  29. </ListBox>
  30. <TextBlock Margin="0 0 0 20" Text="Модули" Classes="mediumText" FontWeight="Bold"/>
  31. <Button Command="{Binding $parent[UserControl].((vm:AllSubjectsModulesAndProgramTemplatesViewModel)DataContext).AddNewModule}" Margin="0 0 0 20" Content="Добавить новый модуль" HorizontalAlignment="Stretch"/>
  32. <ListBox ItemsSource="{Binding Modules}" Margin="0 0 0 25">
  33. <ListBox.ItemTemplate>
  34. <DataTemplate>
  35. <Grid Margin="0 0 0 15">
  36. <Grid.ColumnDefinitions>
  37. <ColumnDefinition Width="3*"/>
  38. <ColumnDefinition Width="1*"/>
  39. </Grid.ColumnDefinitions>
  40. <TextBlock Text="{Binding Name}" Classes="mediumText" TextWrapping="Wrap" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Stretch"/>
  41. <Button Content="Редактировать" Command="{Binding $parent[UserControl].((vm:AllSubjectsModulesAndProgramTemplatesViewModel)DataContext).EditModule}" CommandParameter="{Binding IdModule}" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Stretch"/>
  42. </Grid>
  43. </DataTemplate>
  44. </ListBox.ItemTemplate>
  45. </ListBox>
  46. <TextBlock Margin="0 0 0 20" Text="Шаблоны программ" Classes="mediumText" FontWeight="Bold"/>
  47. <Button Command="{Binding $parent[UserControl].((vm:AllSubjectsModulesAndProgramTemplatesViewModel)DataContext).AddNewProgramTemplate}" Margin="0 0 0 20" Content="Добавить новый шаблон программы" HorizontalAlignment="Stretch"/>
  48. <ListBox ItemsSource="{Binding ProgramTemplates}" Margin="0 0 0 25">
  49. <ListBox.ItemTemplate>
  50. <DataTemplate>
  51. <Grid Margin="0 0 0 15">
  52. <Grid.ColumnDefinitions>
  53. <ColumnDefinition Width="3*"/>
  54. <ColumnDefinition Width="1*"/>
  55. </Grid.ColumnDefinitions>
  56. <TextBlock Text="{Binding NameProgram}" Classes="mediumText" TextWrapping="Wrap" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Stretch"/>
  57. <Button Content="Редактировать" Command="{Binding $parent[UserControl].((vm:AllSubjectsModulesAndProgramTemplatesViewModel)DataContext).EditProgramTemplate}" CommandParameter="{Binding IdProgramTemplate}" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Stretch"/>
  58. </Grid>
  59. </DataTemplate>
  60. </ListBox.ItemTemplate>
  61. </ListBox>
  62. </StackPanel>
  63. </ScrollViewer>
  64. </UserControl>