presence/Presence.Desktop/Views/GroupView.axaml
2024-12-19 11:06:01 +03:00

130 lines
4.8 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:Presence.Desktop.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="Presence.Desktop.Views.GroupView"
x:DataType="vm:GroupViewModel">
<DockPanel Background="#F0F2F5">
<!-- Верхняя панель с комбобоксами -->
<Border DockPanel.Dock="Top"
Background="#FFFFFF"
CornerRadius="10"
Padding="20"
Margin="20"
>
<StackPanel HorizontalAlignment="Center" Spacing="20">
<!-- Первый ComboBox для выбора группы -->
<ComboBox ItemsSource="{Binding Groups}"
SelectedValue="{Binding SelectedGroupItem}"
Width="300"
Background="#F0F2F5"
CornerRadius="5"
FontSize="14">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" FontSize="14" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<!-- Второй ComboBox для выбора способа сортировки -->
<ComboBox ItemsSource="{Binding SortOptions}"
SelectedItem="{Binding SelectedSortOption}"
Width="300"
Background="#F0F2F5"
CornerRadius="5"
FontSize="14">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" FontSize="14" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</StackPanel>
</Border>
<!-- Нижняя панель с кнопками -->
<Border DockPanel.Dock="Bottom"
Background="#FFFFFF"
CornerRadius="10"
Padding="20"
Margin="20"
>
<StackPanel HorizontalAlignment="Center" Spacing="20">
<Button Content="Удалить всех студентов"
Command="{Binding RemoveAllStudentsCommand}"
Width="250"
Background="#FF4D4D"
Foreground="#FFFFFF"
CornerRadius="5"
FontSize="14">
<Button.Styles>
<Style Selector="Button:pointerover">
<Setter Property="Background" Value="#E53935"/>
</Style>
</Button.Styles>
</Button>
<Button Content="Добавить студента"
Command="{Binding AddStudentCommand}"
Width="250"
Background="#4CAF50"
Foreground="#FFFFFF"
CornerRadius="5"
FontSize="14">
<Button.Styles>
<Style Selector="Button:pointerover">
<Setter Property="Background" Value="#43A047"/>
</Style>
</Button.Styles>
</Button>
<Button Content="Перейти на другую страницу"
Command="{Binding NextPageCommand}"
Width="250"
Background="#2196F3"
Foreground="#FFFFFF"
CornerRadius="5"
FontSize="14">
<Button.Styles>
<Style Selector="Button:pointerover">
<Setter Property="Background" Value="#1E88E5"/>
</Style>
</Button.Styles>
</Button>
</StackPanel>
</Border>
<!-- Центральная панель для списка студентов -->
<Border Background="#FFFFFF"
CornerRadius="10"
Padding="20"
Margin="20"
>
<ListBox ItemsSource="{Binding Users}"
Width="500"
SelectionMode="Multiple"
SelectedItems="{Binding SelectedUsers}"
Background="Transparent">
<ListBox.ItemTemplate>
<DataTemplate>
<Border Background="#F0F2F5"
CornerRadius="5"
Padding="10"
Margin="5">
<TextBlock Text="{Binding Name}" FontSize="16" VerticalAlignment="Center" />
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ContextMenu>
<ContextMenu>
<MenuItem Header="Удалить" Click="OnDeleteUserClick"/>
<MenuItem Header="Редактировать" Click="OnEditUserClick"/>
</ContextMenu>
</ListBox.ContextMenu>
</ListBox>
</Border>
</DockPanel>
</UserControl>