AddTeachersView.axaml 5.1 KB

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