TeachersView.axaml 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:vm="using:Teachers.ViewModels"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
  7. x:DataType="vm:TeachersViewModel"
  8. x:Class="Teachers.TeachersView" FontSize="17">
  9. <Grid>
  10. <ScrollViewer>
  11. <StackPanel>
  12. <Button Classes="bDo" Command="{Binding ToAdd}">Добавить учителя</Button>
  13. <ListBox ItemsSource="{Binding TeachersList}">
  14. <ListBox.ItemTemplate>
  15. <DataTemplate>
  16. <Border Classes="bordMain">
  17. <Grid ColumnDefinitions="1*, 0.7*, 0.5*">
  18. <StackPanel Grid.Column="0">
  19. <TextBlock Classes="tbHeader">Личная информация:</TextBlock>
  20. <TextBlock Classes="tbFIO" Text="{Binding FIO}"></TextBlock>
  21. <StackPanel Orientation="Horizontal" Classes="spLittleSp">
  22. <TextBlock Classes="tbLittleHeader">Пол: </TextBlock>
  23. <TextBlock Text="{Binding GenderNavigation.Gender1, StringFormat=' {0}'}"></TextBlock>
  24. </StackPanel>
  25. <StackPanel Orientation="Horizontal" Classes="spLittleSp">
  26. <TextBlock Classes="tbLittleHeader">Дата рождения: </TextBlock>
  27. <TextBlock Text="{Binding Birthday, StringFormat=' dd.MM.yyyy года'}"></TextBlock>
  28. </StackPanel>
  29. <StackPanel Orientation="Horizontal" Classes="spLittleSp">
  30. <TextBlock Classes="tbLittleHeader">Стаж работы: </TextBlock>
  31. <TextBlock Text="{Binding Exp, StringFormat=' {0}'}"></TextBlock>
  32. </StackPanel>
  33. <TextBlock Classes="tbHeader">Контактная информация:</TextBlock>
  34. <Grid ColumnDefinitions="*, *" RowDefinitions="*">
  35. <StackPanel Orientation="Horizontal" Grid.Column="0" Classes="spLittleSp">
  36. <TextBlock Classes="tbLittleHeader">Почта: </TextBlock>
  37. <TextBlock Text="{Binding Email, StringFormat=' {0}'}"></TextBlock>
  38. </StackPanel>
  39. <StackPanel Orientation="Horizontal" Grid.Column="1" Classes="spLittleSp">
  40. <TextBlock Classes="tbLittleHeader">Телефон: </TextBlock>
  41. <TextBlock Text="{Binding Phone, StringFormat=' {0}'}"></TextBlock>
  42. </StackPanel>
  43. </Grid>
  44. <TextBlock Classes="tbHeader" Text="{Binding CoursesHours}"></TextBlock>
  45. <ItemsRepeater ItemsSource="{Binding TeacherCourses}">
  46. <ItemsRepeater.ItemTemplate>
  47. <DataTemplate>
  48. <TextBlock TextWrapping="Wrap" Text="{Binding IdCourseNavigation.Name, StringFormat='- {0}'}"></TextBlock>
  49. </DataTemplate>
  50. </ItemsRepeater.ItemTemplate>
  51. </ItemsRepeater>
  52. </StackPanel>
  53. <StackPanel Grid.Column="1">
  54. <TextBlock Classes="tbHeader">Преподаваемые предметы:</TextBlock>
  55. <ItemsRepeater ItemsSource="{Binding SubjectsTaughts}">
  56. <ItemsRepeater.ItemTemplate>
  57. <DataTemplate>
  58. <TextBlock TextWrapping="Wrap" Text="{Binding IdSubjectNavigation.Name, StringFormat='- {0}'}"></TextBlock>
  59. </DataTemplate>
  60. </ItemsRepeater.ItemTemplate>
  61. </ItemsRepeater>
  62. </StackPanel>
  63. <StackPanel Classes="spButtons" Grid.Column="2">
  64. <Button Classes="bDo" Command="{Binding $parent[UserControl].((vm:TeachersViewModel)DataContext).ToUpdate}" CommandParameter="{Binding Id}">Редактировать</Button>
  65. <Button Classes="bDo" Command="{Binding $parent[UserControl].((vm:TeachersViewModel)DataContext).DeleteTeacher}" CommandParameter="{Binding Id}">Удалить</Button>
  66. </StackPanel>
  67. </Grid>
  68. </Border>
  69. </DataTemplate>
  70. </ListBox.ItemTemplate>
  71. </ListBox>
  72. </StackPanel>
  73. </ScrollViewer>
  74. </Grid>
  75. </UserControl>