123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- <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>
- <!--Поиск-->
- <TextBox Height="40" Classes="tbAddTeacher" Text="{Binding SearchStr}"></TextBox>
- <Grid Classes="gFilters" ColumnDefinitions="0.5*, 0.5*, 0.5*, 0.5*">
- <Border Grid.Column="0" Classes="bordFilters">
- <StackPanel>
- <!--Фильтрация-->
- <RadioButton IsChecked="{Binding RemoveSort}">Все</RadioButton>
- <RadioButton IsChecked="{Binding IsCheckedGender1}">Мужчины</RadioButton>
- <RadioButton IsChecked="{Binding IsCheckedGender2}">Женщины</RadioButton>
- </StackPanel>
- </Border>
- <Border Grid.Column="1" Classes="bordFilters">
- <StackPanel>
- <CheckBox IsChecked="{Binding IsCheckedPhone}">Есть номер телефона</CheckBox>
- <ComboBox Classes="cbFilters" ItemsSource="{Binding SubjectList}" SelectedItem="{Binding SelectedSubject}">
- <ComboBox.ItemTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Name}"></TextBlock>
- </DataTemplate>
- </ComboBox.ItemTemplate>
- </ComboBox>
- </StackPanel>
- </Border>
- <Border Grid.Column="2" Classes="bordFilters">
- <StackPanel>
- <!--Сортировка-->
- <ComboBox Classes="cbFilters" SelectedIndex="{Binding SelectedSort}">
- <ComboBoxItem>Без сортировки</ComboBoxItem>
- <ComboBoxItem>Стаж</ComboBoxItem>
- <ComboBoxItem>Фамилия</ComboBoxItem>
- </ComboBox>
- <StackPanel IsEnabled="{Binding IsEnabledSort}">
- <RadioButton Content="По возрастанию" IsChecked="{Binding SortUp}"/>
- <RadioButton Content="По убыванию" IsChecked="{Binding SortDown}"/>
- </StackPanel>
- </StackPanel>
- </Border>
- <Border Classes="bordFilters" Grid.Column="3">
- <StackPanel>
- <TextBlock Margin="0 7 0 7" TextWrapping="Wrap">Сортировать по общему количеству часов курсов</TextBlock>
- <StackPanel IsEnabled="{Binding}">
- <RadioButton IsChecked="{Binding RemoveSortHours}">Без сортировки</RadioButton>
- <RadioButton Content="По возрастанию" IsChecked="{Binding SortUpHours}"/>
- <RadioButton Content="По убыванию" IsChecked="{Binding SortDownHours}"/>
- </StackPanel>
- </StackPanel>
- </Border>
- </Grid>
- <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>
|