EditAndAddProgram.axaml 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. xmlns:vm="using:AvaloniaApplication4.ViewModels"
  7. x:DataType="vm:EditAndAddProgramViewModel"
  8. Background="White"
  9. Padding="80"
  10. x:Class="AvaloniaApplication4.Views.ActionPages.EditAndAddProgram">
  11. <ScrollViewer>
  12. <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="0 20 0 0">
  13. <TextBlock Text="Программы" Classes="titleStyle" FontWeight="Bold" Margin="0 0 0 36"/>
  14. <TextBlock Text="Наименование программы" Classes="litleText" FontWeight="Bold" FontSize="24" Margin="0 0 0 20"/>
  15. <ComboBox HorizontalAlignment="Stretch" Margin="0 0 0 20" ItemsSource="{Binding ProgramTemplates}" SelectedIndex="{Binding IdRunningProgramTemplate, Mode=TwoWay}">
  16. <ComboBox.ItemTemplate>
  17. <DataTemplate>
  18. <StackPanel Orientation="Vertical">
  19. <TextBlock FontSize="16" Text="{Binding NameProgram}"/>
  20. <TextBlock FontSize="14" Text="{Binding CodeProgram}"/>
  21. </StackPanel>
  22. </DataTemplate>
  23. </ComboBox.ItemTemplate>
  24. </ComboBox>
  25. <TextBlock Text="Модули программы" Classes="litleText" FontWeight="Bold" FontSize="24" Margin="0 0 0 24"/>
  26. <Button Content="Добавить модуль" Command="{Binding $parent[UserControl].((vm:EditAndAddProgramViewModel)DataContext).AddNewModule}" HorizontalAlignment="Stretch" Margin="0 0 0 24"/>
  27. <ListBox Margin="0 0 0 20" ItemsSource="{Binding BindingsModules}">
  28. <ListBox.ItemTemplate>
  29. <DataTemplate>
  30. <Grid>
  31. <Grid.ColumnDefinitions>
  32. <ColumnDefinition Width="3*"/>
  33. <ColumnDefinition Width="1*"/>
  34. </Grid.ColumnDefinitions>
  35. <ComboBox ItemsSource="{Binding AllModules}" SelectedItem="{Binding Module, Mode=TwoWay}" Grid.Column="0" FontSize="16" HorizontalAlignment="Stretch" Margin="0 0 10 0">
  36. <ComboBox.ItemTemplate>
  37. <DataTemplate>
  38. <StackPanel Orientation="Vertical">
  39. <TextBlock Text="{Binding Name}"/>
  40. </StackPanel>
  41. </DataTemplate>
  42. </ComboBox.ItemTemplate>
  43. </ComboBox>
  44. <Button Content="Удалить" Command="{Binding $parent[UserControl].((vm:EditAndAddProgramViewModel)DataContext).DeleteOneModule}" CommandParameter="{Binding Id}" Grid.Column="1" HorizontalAlignment="Stretch" Margin="10 0 0 0"/>
  45. </Grid>
  46. </DataTemplate>
  47. </ListBox.ItemTemplate>
  48. </ListBox>
  49. <TextBlock Text="Предметы программы" Classes="litleText" FontWeight="Bold" FontSize="24" Margin="0 0 0 24"/>
  50. <Button Content="Добавить предмет" Command="{Binding $parent[UserControl].((vm:EditAndAddProgramViewModel)DataContext).AddNewSubject}" HorizontalAlignment="Stretch" Margin="0 0 0 24"/>
  51. <ListBox ItemsSource="{Binding BindingSubjects1}" Margin="0 0 0 40">
  52. <ListBox.ItemTemplate>
  53. <DataTemplate>
  54. <Grid>
  55. <Grid.ColumnDefinitions>
  56. <ColumnDefinition Width="3*"/>
  57. <ColumnDefinition Width="1*"/>
  58. </Grid.ColumnDefinitions>
  59. <ComboBox ItemsSource="{Binding AllSubjects}" SelectedItem="{Binding Subject}" Grid.Column="0" FontSize="16" HorizontalAlignment="Stretch" Margin="0 0 10 0">
  60. <ComboBox.ItemTemplate>
  61. <DataTemplate>
  62. <TextBlock Text="{Binding NameSubject}"/>
  63. </DataTemplate>
  64. </ComboBox.ItemTemplate>
  65. </ComboBox>
  66. <Button Content="Удалить" Command="{Binding $parent[UserControl].((vm:EditAndAddProgramViewModel)DataContext).DeleteOneSubject}" CommandParameter="{Binding Id}" Grid.Column="1" HorizontalAlignment="Stretch" Margin="10 0 0 0"/>
  67. </Grid>
  68. </DataTemplate>
  69. </ListBox.ItemTemplate>
  70. </ListBox>
  71. <Button Content="{Binding BtnContent}" HorizontalAlignment="Stretch" Margin="0 0 0 40"/>
  72. <Grid Margin="0 0 0 40">
  73. <Grid.ColumnDefinitions>
  74. <ColumnDefinition Width="1*"/>
  75. <ColumnDefinition Width="1*"/>
  76. </Grid.ColumnDefinitions>
  77. <Button HorizontalAlignment="Stretch" Grid.Column="0" Content="Сохранить" Margin="0 0 5 0"/>
  78. <Button HorizontalAlignment="Stretch" Grid.Column="1" Content="Удалить программу" Margin="5 0 0 0"/>
  79. </Grid>
  80. <Button Content="Вернуться назад" Command="{Binding $parent[UserControl].((vm:EditAndAddProgramViewModel)DataContext).GoBack}" HorizontalAlignment="Stretch"/>
  81. </StackPanel>
  82. </ScrollViewer>
  83. </UserControl>