ShowTeachersView.axaml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. xmlns:viewmodel="using:Prakt12.ViewModels"
  7. x:Class="Prak12.Views.ShowTeachersView">
  8. <UserControl.Styles>
  9. <Style Selector="ItemsRepeater.CourcesRepeater">
  10. <Setter Property="ItemTemplate">
  11. <DataTemplate>
  12. <Grid>
  13. <Grid.ColumnDefinitions>
  14. <ColumnDefinition Width="auto"/>
  15. <ColumnDefinition/>
  16. </Grid.ColumnDefinitions>
  17. <TextBlock Grid.Column="0" Text="- "/>
  18. <TextBlock Grid.Column="1" Text="{Binding IdCourseNavigation.CourseName}"/>
  19. </Grid>
  20. </DataTemplate>
  21. </Setter>
  22. </Style>
  23. <Style Selector="ItemsRepeater.SubjectsRepeater">
  24. <Setter Property="ItemTemplate">
  25. <DataTemplate>
  26. <Grid>
  27. <Grid.ColumnDefinitions>
  28. <ColumnDefinition Width="auto"/>
  29. <ColumnDefinition/>
  30. </Grid.ColumnDefinitions>
  31. <TextBlock Grid.Column="0" Text="- "/>
  32. <TextBlock Grid.Column="1" Text="{Binding IdSubjectNavigation.SubjectName}"/>
  33. </Grid>
  34. </DataTemplate>
  35. </Setter>
  36. </Style>
  37. <Style Selector="ListBox.MainListBox">
  38. <Setter Property="ItemTemplate">
  39. <DataTemplate>
  40. <Border BorderThickness="1" BorderBrush="#9b2d30"
  41. Padding="30 30 30 20">
  42. <Grid>
  43. <Grid.ColumnDefinitions>
  44. <ColumnDefinition/>
  45. <ColumnDefinition/>
  46. </Grid.ColumnDefinitions>
  47. <StackPanel Orientation="Vertical"
  48. Grid.Column="0">
  49. <Label Content="Личная информация:"
  50. FontWeight="Bold"
  51. Padding="0"/>
  52. <TextBlock Text="{Binding FIO}"/>
  53. <TextBlock Text="{Binding LabeledGender}"/>
  54. <TextBlock Text="{Binding LabeledBirthDate}"/>
  55. <TextBlock Text="{Binding LabeledWorkTime}"/>
  56. <Label Content="Контактная информация:"
  57. FontWeight="Bold"
  58. Padding="0"/>
  59. <Grid>
  60. <Grid.ColumnDefinitions>
  61. <ColumnDefinition Width="auto"/>
  62. <ColumnDefinition />
  63. </Grid.ColumnDefinitions>
  64. <TextBlock Grid.Column="0"
  65. Text="{Binding LabeledEmail}"
  66. Margin="0 0 20 0"/>
  67. <TextBlock Grid.Column="1"
  68. Text="{Binding LabeledPhone}"/>
  69. </Grid>
  70. <Label Content="{Binding LabeledSummaryVolume}"
  71. FontWeight="Bold"
  72. Padding="0"/>
  73. <ItemsRepeater ItemsSource="{Binding TeachersCourses}"
  74. Classes="CourcesRepeater"/>
  75. </StackPanel>
  76. <StackPanel Orientation="Vertical"
  77. Grid.Column="1">
  78. <Label Content="Преподаваемые предметы:"
  79. FontWeight="Bold"
  80. Padding="0"/>
  81. <ItemsRepeater ItemsSource="{Binding TeachersSubjects}"
  82. Classes="SubjectsRepeater"
  83. Margin="1 0 0 0"/>
  84. </StackPanel>
  85. </Grid>
  86. </Border>
  87. </DataTemplate>
  88. </Setter>
  89. </Style>
  90. </UserControl.Styles>
  91. <Border Padding="10">
  92. <Grid>
  93. <Grid.RowDefinitions>
  94. <RowDefinition Height="auto"/>
  95. <RowDefinition/>
  96. </Grid.RowDefinitions>
  97. <Grid.ColumnDefinitions>
  98. <ColumnDefinition/>
  99. <ColumnDefinition/>
  100. </Grid.ColumnDefinitions>
  101. <Label Content="Список преподавателей"
  102. FontSize="16" FontWeight="Bold"
  103. Margin="0 0 0 10"
  104. HorizontalAlignment="Center" Grid.ColumnSpan="2"/>
  105. <Button Grid.Column="0" Grid.Row="0"
  106. Width="220" Height="30"
  107. Margin="0 0 0 10"
  108. VerticalAlignment="Center"
  109. HorizontalAlignment="Left"
  110. HorizontalContentAlignment="Center"
  111. Command="{Binding AddNewTeacherCommand}"
  112. Background="White"
  113. BorderBrush="Blue"
  114. BorderThickness="1">
  115. <TextBlock Text="Добавить преподавателя"
  116. Foreground="Blue"
  117. Background="#0000"/>
  118. </Button>
  119. <ListBox Grid.Row="1" Grid.ColumnSpan="2"
  120. Classes="MainListBox"
  121. ItemsSource="{Binding TeachersCollection}"/>
  122. </Grid>
  123. </Border>
  124. </UserControl>