EditAndAddStudent.axaml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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.EditAndAddStudent"
  7. xmlns:vm="using:AvaloniaApplication4.ViewModels"
  8. x:DataType="vm:EditAndAddStudentViewModel"
  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 39" Text="Студенты" Classes="titleStyle" FontWeight="Bold"/>
  14. <TextBlock Margin="0 0 0 20" Text="Личные данные" Classes="mediumText" FontSize="24" FontWeight="Bold"/>
  15. <TextBlock Margin="0 0 0 13" Text="Имя" Classes="litleText"/>
  16. <TextBox Text="{Binding Student.Name}" Margin="0 0 0 22" Watermark="Имя"/>
  17. <TextBlock Margin="0 0 0 13" Text="Фамилия" Classes="litleText"/>
  18. <TextBox Text="{Binding Student.Surname}" Margin="0 0 0 22" Watermark="Фамилия"/>
  19. <TextBlock Margin="0 0 0 13" Text="Отчество" Classes="litleText"/>
  20. <TextBox Text="{Binding Student.Patronumic}" Margin="0 0 0 22" Watermark="Отчество"/>
  21. <TextBlock Margin="0 0 0 13" Text="Образование" Classes="litleText"/>
  22. <ComboBox Margin="0 0 0 22" ItemsSource="{Binding AllEducations}" SelectedIndex="{Binding IdEducationStudent, Mode=TwoWay}" HorizontalAlignment="Stretch">
  23. <ComboBox.ItemTemplate>
  24. <DataTemplate>
  25. <TextBlock Text="{Binding Name}"/>
  26. </DataTemplate>
  27. </ComboBox.ItemTemplate>
  28. </ComboBox>
  29. <TextBlock Margin="0 0 0 20" Text="Программа" Classes="mediumText" FontSize="24" FontWeight="Bold"/>
  30. <ComboBox Margin="0 0 0 22" ItemsSource="{Binding AllPrograms}" SelectedIndex="{Binding IdProgramStudent, Mode=TwoWay}" HorizontalAlignment="Stretch">
  31. <ComboBox.ItemTemplate>
  32. <DataTemplate>
  33. <TextBlock Text="{Binding IdProgramTemplateNavigation.NameProgram}"/>
  34. </DataTemplate>
  35. </ComboBox.ItemTemplate>
  36. </ComboBox>
  37. <Grid Margin="0 0 0 30">
  38. <Grid.ColumnDefinitions>
  39. <ColumnDefinition Width="1*"/>
  40. <ColumnDefinition Width="1*"/>
  41. </Grid.ColumnDefinitions>
  42. <Button Name="saveBtn" HorizontalAlignment="Stretch" Margin="5" Content="Сохранить студента" Grid.Column="0" Command="{Binding $parent[UserControl].((vm:EditAndAddStudentViewModel)DataContext).Save}"/>
  43. <Button Name="delBtn" HorizontalAlignment="Stretch" Margin="5" Content="Удалить студента" Grid.Column="1" Command="{Binding $parent[UserControl].((vm:EditAndAddStudentViewModel)DataContext).Delete}"/>
  44. </Grid>
  45. <Button HorizontalAlignment="Stretch" Content="Вернуться назад" Command="{Binding $parent[UserControl].((vm:EditAndAddStudentViewModel)DataContext).GoBack}"/>
  46. </StackPanel>
  47. </ScrollViewer>
  48. </UserControl>