12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <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:DataType="vm:TeachersViewModel"
- x:Class="Teachers.TeachersView" FontSize="17">
- <Grid>
- <ScrollViewer>
- <StackPanel>
- <Button Classes="bDo" Command="{Binding ToAdd}">Добавить учителя</Button>
- <ListBox ItemsSource="{Binding TeachersList}">
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Border Classes="bordMain">
- <Grid ColumnDefinitions="1*, 0.7*, 0.5*">
- <StackPanel Grid.Column="0">
- <TextBlock Classes="tbHeader">Личная информация:</TextBlock>
- <TextBlock Classes="tbFIO" Text="{Binding FIO}"></TextBlock>
- <StackPanel Orientation="Horizontal" Classes="spLittleSp">
- <TextBlock Classes="tbLittleHeader">Пол: </TextBlock>
- <TextBlock Text="{Binding GenderNavigation.Gender1, StringFormat=' {0}'}"></TextBlock>
- </StackPanel>
- <StackPanel Orientation="Horizontal" Classes="spLittleSp">
- <TextBlock Classes="tbLittleHeader">Дата рождения: </TextBlock>
- <TextBlock Text="{Binding Birthday, StringFormat=' dd.MM.yyyy года'}"></TextBlock>
- </StackPanel>
- <StackPanel Orientation="Horizontal" Classes="spLittleSp">
- <TextBlock Classes="tbLittleHeader">Стаж работы: </TextBlock>
- <TextBlock Text="{Binding Exp, StringFormat=' {0}'}"></TextBlock>
- </StackPanel>
- <TextBlock Classes="tbHeader">Контактная информация:</TextBlock>
- <Grid ColumnDefinitions="*, *" RowDefinitions="*">
- <StackPanel Orientation="Horizontal" Grid.Column="0" Classes="spLittleSp">
- <TextBlock Classes="tbLittleHeader">Почта: </TextBlock>
- <TextBlock Text="{Binding Email, StringFormat=' {0}'}"></TextBlock>
- </StackPanel>
- <StackPanel Orientation="Horizontal" Grid.Column="1" Classes="spLittleSp">
- <TextBlock Classes="tbLittleHeader">Телефон: </TextBlock>
- <TextBlock Text="{Binding Phone, StringFormat=' {0}'}"></TextBlock>
- </StackPanel>
- </Grid>
- <TextBlock Classes="tbHeader" Text="{Binding CoursesHours}"></TextBlock>
- <ItemsRepeater ItemsSource="{Binding TeacherCourses}">
- <ItemsRepeater.ItemTemplate>
- <DataTemplate>
- <TextBlock TextWrapping="Wrap" Text="{Binding IdCourseNavigation.Name, StringFormat='- {0}'}"></TextBlock>
- </DataTemplate>
- </ItemsRepeater.ItemTemplate>
- </ItemsRepeater>
- </StackPanel>
- <StackPanel Grid.Column="1">
- <TextBlock Classes="tbHeader">Преподаваемые предметы:</TextBlock>
- <ItemsRepeater ItemsSource="{Binding SubjectsTaughts}">
- <ItemsRepeater.ItemTemplate>
- <DataTemplate>
- <TextBlock TextWrapping="Wrap" Text="{Binding IdSubjectNavigation.Name, StringFormat='- {0}'}"></TextBlock>
- </DataTemplate>
- </ItemsRepeater.ItemTemplate>
- </ItemsRepeater>
- </StackPanel>
- <StackPanel Classes="spButtons" Grid.Column="2">
- <Button Classes="bDo" Command="{Binding $parent[UserControl].((vm:TeachersViewModel)DataContext).ToUpdate}" CommandParameter="{Binding Id}">Редактировать</Button>
- <Button Classes="bDo" Command="{Binding $parent[UserControl].((vm:TeachersViewModel)DataContext).DeleteTeacher}" CommandParameter="{Binding Id}">Удалить</Button>
- </StackPanel>
- </Grid>
- </Border>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </StackPanel>
- </ScrollViewer>
- </Grid>
- </UserControl>
|