12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <UserControl xmlns="https://github.com/avaloniaui"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:vm="using:Teachers.ViewModels"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
- x:Class="Teachers.AddTeacherView"
- x:DataType="vm:AddTeacherViewModel"
- xmlns:conv="using:Teachers.Converters">
- <UserControl.Resources>
- <conv:DateConverter x:Key="myConv"/>
- </UserControl.Resources>
- <Grid>
- <ScrollViewer>
- <StackPanel>
- <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
- <Button Classes="bAddTeacher" Command="{Binding ToTeachersView}">Назад</Button>
- <Button Classes="bAddTeacher" Command="{Binding AddTeacher}" Content="{Binding ButtonText}"></Button>
- <Button Classes="bAddTeacher" Command="{Binding ShowAddCourse}">Добавить курс</Button>
- </StackPanel>
- <TextBox Watermark="Фамилия" Classes="tbAddTeacher" Text="{Binding NewTeacher.Surname}"></TextBox>
- <TextBox Watermark="Имя" Classes="tbAddTeacher" Text="{Binding NewTeacher.Name}"></TextBox>
- <TextBox Watermark="Отчество" Classes="tbAddTeacher" Text="{Binding NewTeacher.Patronymic}"></TextBox>
- <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
- <ComboBox Classes="cbAddTeacherGender" PlaceholderText="Выберите пол" ItemsSource="{Binding GendersL}" SelectedItem="{Binding NewTeacher.GenderNavigation}">
- <ComboBox.ItemTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Gender1}"></TextBlock>
- </DataTemplate>
- </ComboBox.ItemTemplate>
- </ComboBox>
- <DatePicker Classes="dpAddTeacher" SelectedDate="{Binding NewTeacher.Birthday, Converter={StaticResource myConv}}"></DatePicker>
- </StackPanel>
- <TextBox Watermark="Опыт (месяцев)" Classes="tbAddTeacher" Text="{Binding NewTeacher.Experience}"></TextBox>
- <TextBox Watermark="Почта" Classes="tbAddTeacher" Text="{Binding NewTeacher.Email}"></TextBox>
- <TextBox Watermark="Телефон" Classes="tbAddTeacher" Text="{Binding NewTeacher.Phone}"></TextBox>
- <Grid ColumnDefinitions="*, *">
- <StackPanel HorizontalAlignment="Left" Grid.Column="0">
- <ComboBox Classes="cbAddTeacher" ItemsSource="{Binding CoursesL}" SelectedValue="{Binding SelectedCourse}">
- <ComboBox.ItemTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Name}"></TextBlock>
- </DataTemplate>
- </ComboBox.ItemTemplate>
- </ComboBox>
- <ListBox Classes="lbAddTeacher" ItemsSource="{Binding CoursesTable}">
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Border Classes="lbiAddTeacher">
- <Grid Classes="lbiAddTeacher" ColumnDefinitions="*, *">
- <TextBlock TextWrapping="Wrap" VerticalAlignment="Center" Grid.Column="0" Text="{Binding IdCourseNavigation.Name}"></TextBlock>
- <Button Grid.Column="1" Classes="bDelCourse" Command="{Binding $parent[UserControl].((vm:AddTeacherViewModel)DataContext).DeleteCourse}" CommandParameter="{Binding}">x</Button>
- </Grid>
- </Border>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </StackPanel>
- <StackPanel HorizontalAlignment="Left" Grid.Column="1">
- <ComboBox Classes="cbAddTeacher" ItemsSource="{Binding SubjectsL}" SelectedValue="{Binding SelectedSubject}">
- <ComboBox.ItemTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Name}"></TextBlock>
- </DataTemplate>
- </ComboBox.ItemTemplate>
- </ComboBox>
- <ListBox Classes="lbAddTeacher" ItemsSource="{Binding SubjectsTable}">
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Border Classes="lbiAddTeacher">
- <Grid ColumnDefinitions="*, *">
- <TextBlock TextWrapping="Wrap" VerticalAlignment="Center" Grid.Column="0" Text="{Binding IdSubjectNavigation.Name}"></TextBlock>
- <Button Grid.Column="1" Classes="bDelCourse" Command="{Binding $parent[UserControl].((vm:AddTeacherViewModel)DataContext).DeleteSubject}" CommandParameter="{Binding}">x</Button>
- </Grid>
- </Border>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </StackPanel>
- </Grid>
- </StackPanel>
- </ScrollViewer>
- </Grid>
- </UserControl>
|