ShowTeachersView.axaml 4.1 KB

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