AddTeachersView.axaml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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="600"
  6. x:Class="Prak12.Views.AddTeachersView">
  7. <UserControl.Styles>
  8. <Style Selector="HeaderedContentControl">
  9. <Setter Property="Template">
  10. <Setter.Value>
  11. <ControlTemplate>
  12. <Grid>
  13. <Grid.RowDefinitions>
  14. <RowDefinition Height="Auto"/>
  15. <RowDefinition Height="*"/>
  16. </Grid.RowDefinitions>
  17. <TextBlock TextBlock.FontWeight="Bold" Text="{TemplateBinding Header}"
  18. Margin="10 0 0 0"/>
  19. <ContentPresenter Grid.Row="1" Content="{TemplateBinding Content}" />
  20. </Grid>
  21. </ControlTemplate>
  22. </Setter.Value>
  23. </Setter>
  24. </Style>
  25. <Style Selector="ListBox.SelectedSubjectsList">
  26. <Setter Property="ItemTemplate">
  27. <DataTemplate>
  28. <Grid>
  29. <Grid.ColumnDefinitions>
  30. <ColumnDefinition Width="auto"/>
  31. <ColumnDefinition/>
  32. </Grid.ColumnDefinitions>
  33. <TextBlock Grid.Column="0" Text="- "/>
  34. <TextBlock Grid.Column="1" Text="{Binding SubjectName}"/>
  35. </Grid>
  36. </DataTemplate>
  37. </Setter>
  38. </Style>
  39. </UserControl.Styles>
  40. <Border Padding="10">
  41. <Grid>
  42. <Grid.RowDefinitions>
  43. <RowDefinition/>
  44. <RowDefinition/>
  45. <RowDefinition/>
  46. <RowDefinition/>
  47. <RowDefinition/>
  48. <RowDefinition/>
  49. <RowDefinition/>
  50. <RowDefinition/>
  51. </Grid.RowDefinitions>
  52. <Grid.ColumnDefinitions>
  53. <ColumnDefinition/>
  54. <ColumnDefinition/>
  55. </Grid.ColumnDefinitions>
  56. <Label Content="Добавление преподавателя"
  57. FontSize="16" FontWeight="Bold" Grid.ColumnSpan="2"
  58. HorizontalAlignment="Center" Grid.Row="0"/>
  59. <Button Height="30" Width="30"
  60. Background="Red"
  61. Foreground="White"
  62. Content="X"
  63. HorizontalContentAlignment="Center"
  64. VerticalContentAlignment="Center"
  65. Command="{Binding CancelAddNewTeacherCommand}"
  66. VerticalAlignment="Top"/>
  67. <Grid Grid.Row="1" Grid.ColumnSpan="2">
  68. <Grid.ColumnDefinitions>
  69. <ColumnDefinition/>
  70. <ColumnDefinition/>
  71. <ColumnDefinition/>
  72. </Grid.ColumnDefinitions>
  73. <HeaderedContentControl Grid.Column="0"
  74. Header="Фамилия"
  75. Height="55"
  76. Margin="0 0 5 0">
  77. <TextBox VerticalAlignment="Center" Text="{Binding Teacher.TeacherSurname}"/>
  78. </HeaderedContentControl>
  79. <HeaderedContentControl Grid.Column="1"
  80. Header="Имя"
  81. Height="55"
  82. Margin="0 0 5 0">
  83. <TextBox VerticalAlignment="Center" Text="{Binding Teacher.TeacherName}"/>
  84. </HeaderedContentControl>
  85. <HeaderedContentControl Grid.Column="2"
  86. Header="Отчество"
  87. Height="55">
  88. <TextBox VerticalAlignment="Center" Text="{Binding Teacher.TeacherPatronymic}"/>
  89. </HeaderedContentControl>
  90. </Grid>
  91. <DatePicker Grid.Row="2" Grid.Column="1" SelectedDate="{Binding Date}" Margin="10 0 0 5"/>
  92. <ComboBox Grid.Row="3" Grid.Column="1" SelectedIndex="{Binding GenderComboboxId}" Margin="10 0 0 5">
  93. <ComboBoxItem>Мужчина</ComboBoxItem>
  94. <ComboBoxItem>Женщина</ComboBoxItem>
  95. </ComboBox>
  96. <HeaderedContentControl Grid.Row="4"
  97. Header="Стаж"
  98. Height="55"
  99. Grid.Column="1" Margin="10 0 0 5">
  100. <TextBox VerticalAlignment="Center" Text="{Binding TeacherWorkTime}"/>
  101. </HeaderedContentControl>
  102. <HeaderedContentControl Grid.Row="5"
  103. Header="Электронная почта"
  104. Height="55"
  105. Grid.Column="1"
  106. Margin="10 0 0 5">
  107. <TextBox VerticalAlignment="Center" Text="{Binding Teacher.TeacherEmail}"/>
  108. </HeaderedContentControl>
  109. <HeaderedContentControl Grid.Row="6"
  110. Header="Телефон"
  111. Height="55"
  112. Grid.Column="1"
  113. Margin="10 0 0 5">
  114. <TextBox VerticalAlignment="Center" Text="{Binding Teacher.TeacherPhoneNumber}"/>
  115. </HeaderedContentControl>
  116. <Grid Grid.Row="2" Grid.Column="0"
  117. Grid.RowSpan="5" >
  118. <Grid.RowDefinitions>
  119. <RowDefinition Height="auto"/>
  120. <RowDefinition/>
  121. </Grid.RowDefinitions>
  122. <ComboBox Grid.Row="0" Margin="0 0 0 10"
  123. HorizontalAlignment="Stretch"
  124. SelectedIndex="{Binding SelectedComboBoxSubjectId}"
  125. ItemsSource="{Binding UnselectedSubjects}"/>
  126. <ListBox Grid.Row="1"
  127. Classes="SelectedSubjectsList"
  128. ItemsSource="{Binding SelectedSubjects}"
  129. SelectedIndex="{Binding SelectedListBoxSubjectId}"/>
  130. </Grid>
  131. <Button Grid.Row="7" HorizontalAlignment="Stretch"
  132. VerticalAlignment="Stretch" Margin="80 5 80 0"
  133. Width="400" Height="40"
  134. Background="White"
  135. BorderBrush="Blue"
  136. BorderThickness="1"
  137. Grid.ColumnSpan="2" Command="{Binding AddNewTeacherCommand}">
  138. <TextBlock Text="Добавить преподавателя"
  139. HorizontalAlignment="Center"
  140. Foreground="Blue"
  141. VerticalAlignment="Center"/>
  142. </Button>
  143. </Grid>
  144. </Border>
  145. </UserControl>