AddTeacher.axaml 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. x:DataType="vm:MainWindowViewModel"
  6. xmlns:vm="using:AvaloniaTeachersDB.ViewModels"
  7. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="600"
  8. x:Class="AvaloniaTeachersDB.Views.AddTeacher">
  9. <UserControl.Styles>
  10. <Style Selector="TextBox.fio" >
  11. <Setter Property="Width" Value="150"/>
  12. <Setter Property="Height" Value="30"/>
  13. <Setter Property="Margin" Value="0,15,20,15"/>
  14. <Setter Property="HorizontalAlignment" Value="Left"/>
  15. </Style>
  16. <Style Selector="Button.add" >
  17. <Setter Property="Width" Value="150"/>
  18. <Setter Property="Height" Value="30"/>
  19. <Setter Property="Margin" Value="20"/>
  20. <Setter Property="Padding" Value="10,0,10,0"/>
  21. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  22. <Setter Property="VerticalContentAlignment" Value="Center"/>
  23. </Style>
  24. </UserControl.Styles>
  25. <Grid>
  26. <StackPanel Orientation="Vertical" HorizontalAlignment="Left" Margin="15">
  27. <StackPanel Orientation="Horizontal">
  28. <TextBox Watermark="Фамилия" Classes="fio" Text="{Binding AddTeacher.TSurname}"/>
  29. <TextBox Watermark="Имя" Classes="fio" Text="{Binding AddTeacher.TName}"/>
  30. <TextBox Watermark="Отчество" Classes="fio" Text="{Binding AddTeacher.TPatronymic}"/>
  31. </StackPanel>
  32. <DatePicker Margin="0,15,20,15" SelectedDate="{Binding AddTeacher.TBirthday}"/>
  33. <StackPanel Orientation="Horizontal">
  34. <RadioButton Content="Мужской" Margin="0,0,20,0" IsChecked="{Binding AddTeacher.TGenderM}"/>
  35. <RadioButton Content="Женский" Margin="0,15,20,15"/>
  36. </StackPanel>
  37. <StackPanel Orientation="Horizontal">
  38. <TextBlock Text="Стаж работы" VerticalAlignment="Center" Margin="0,0,20,0"/>
  39. <TextBox Text="{Binding AddTeacher.TExp}"/>
  40. </StackPanel>
  41. <TextBox Watermark="example@mail.com" Margin="0,10,10,0" Text="{Binding AddTeacher.TMail}"/>
  42. <TextBox Watermark="880005553535" Classes="fio" Text="{Binding AddTeacher.TPhone}"/>
  43. <StackPanel Orientation="Horizontal">
  44. <ComboBox Width="400" ItemsSource="{Binding AddTeacher.CollSub}" SelectedItem="{Binding AddTeacher.SelectSubject}" MaxDropDownHeight="250">
  45. <ComboBox.ItemTemplate>
  46. <DataTemplate>
  47. <TextBlock Text="{Binding NameSubjects}"/>
  48. </DataTemplate>
  49. </ComboBox.ItemTemplate>
  50. </ComboBox>
  51. <ListBox ItemsSource="{Binding AddTeacher.CollSubSelect}" Width="300" Height="150" Margin="30,0,0,0">
  52. <ListBox.ItemTemplate>
  53. <DataTemplate>
  54. <TextBlock Text="{Binding NameSubjects}"/>
  55. </DataTemplate>
  56. </ListBox.ItemTemplate>
  57. </ListBox>
  58. </StackPanel>
  59. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  60. <Button Content="Добавить" Classes="add" Command="{Binding ToAddNewTeacher}"/>
  61. <Button Content="Назад" Classes="add" Command="{Binding ToPersInf}"/>
  62. </StackPanel>
  63. </StackPanel>
  64. </Grid>
  65. </UserControl>