63 lines
3.0 KiB
Plaintext
63 lines
3.0 KiB
Plaintext
|
<Window xmlns="https://github.com/avaloniaui"
|
||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||
|
xmlns:vm="using:Desktop.UI.ViewModels"
|
||
|
xmlns:reactive="http://reactiveui.net"
|
||
|
x:Class="Desktop.UI.Views.GroupWindow"
|
||
|
x:DataType="vm:GroupWindowViewModel"
|
||
|
Title="Группы и студенты"
|
||
|
Width="800" Height="600">
|
||
|
|
||
|
<Window.Resources>
|
||
|
<!-- Примеры простых конвертеров -->
|
||
|
</Window.Resources>
|
||
|
|
||
|
<DockPanel Margin="10">
|
||
|
<!-- Верхняя панель -->
|
||
|
<StackPanel Orientation="Horizontal" DockPanel.Dock="Top" Margin="0 0 0 10" Spacing="10">
|
||
|
<ComboBox ItemsSource="{Binding Groups}"
|
||
|
SelectedItem="{Binding SelectedGroup}"
|
||
|
Width="200">
|
||
|
<ComboBox.ItemTemplate>
|
||
|
<DataTemplate>
|
||
|
<TextBlock Text="{Binding Name}" />
|
||
|
</DataTemplate>
|
||
|
</ComboBox.ItemTemplate>
|
||
|
</ComboBox>
|
||
|
|
||
|
<Button Content="Удалить всех студентов"
|
||
|
Command="{Binding DeleteAllStudentsCommand}"
|
||
|
IsEnabled="{Binding SelectedGroup, Converter={StaticResource NullToBoolConverter}}"/>
|
||
|
|
||
|
<ComboBox ItemsSource="{Binding SortOptions}"
|
||
|
SelectedItem="{Binding SelectedSortOption}"
|
||
|
Width="200"/>
|
||
|
</StackPanel>
|
||
|
|
||
|
<!-- Список студентов -->
|
||
|
<ListBox ItemsSource="{Binding FilteredAndSortedStudents}"
|
||
|
ListBox.SelectedItems="{Binding SelectedStudents}"
|
||
|
SelectionMode="Multiple">
|
||
|
<ListBox.ItemTemplate>
|
||
|
<DataTemplate>
|
||
|
<TextBlock Text="{Binding FIO}" />
|
||
|
</DataTemplate>
|
||
|
</ListBox.ItemTemplate>
|
||
|
|
||
|
<ListBox.ContextMenu>
|
||
|
<ContextMenu>
|
||
|
<MenuItem Header="Изменить"
|
||
|
Command="{Binding EditStudentCommand}"
|
||
|
CommandParameter="{Binding Path=SelectedStudents[0]}"
|
||
|
IsVisible="{Binding SelectedStudents.Count, Converter={StaticResource EqualsToOneConverter}, ConverterParameter=true}"/>
|
||
|
<MenuItem Header="Удалить"
|
||
|
Command="{Binding DeleteStudentCommand}"
|
||
|
CommandParameter="{Binding Path=SelectedStudents[0]}"
|
||
|
IsVisible="{Binding SelectedStudents.Count, Converter={StaticResource EqualsToOneConverter}, ConverterParameter=true}"/>
|
||
|
<MenuItem Header="Удалить выбранные"
|
||
|
Command="{Binding DeleteSelectedStudentsCommand}"
|
||
|
IsVisible="{Binding SelectedStudents.Count, Converter={StaticResource GreaterThanOneConverter}, ConverterParameter=true}"/>
|
||
|
</ContextMenu>
|
||
|
</ListBox.ContextMenu>
|
||
|
</ListBox>
|
||
|
</DockPanel>
|
||
|
</Window>
|