presence/Presence.Desktop/Views/MainWindow.axaml

66 lines
2.9 KiB
Plaintext
Raw Normal View History

2024-11-24 18:05:17 +00:00
<Window 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.MainWindow"
Icon="/Assets/avalonia-logo.ico"
Title="Presence.Desktop"
2024-12-16 04:10:04 +00:00
x:DataType="vm:MainWindowViewModel"
xmlns:local="clr-namespace:Presence.Desktop.ViewModels"
DataContext="{Binding RelativeSource={RelativeSource Self}}">
2024-11-24 18:05:17 +00:00
<DockPanel Background="White">
2024-12-04 18:00:36 +00:00
<!-- Верхняя панель с комбобоксами -->
<StackPanel DockPanel.Dock="Top" HorizontalAlignment="Center" Margin="20">
<!-- Первый ComboBox для выбора группы -->
2024-12-16 04:10:04 +00:00
<ComboBox Foreground="Black" ItemsSource="{Binding Groups}" SelectedValue="{Binding SelectedGroupItem}" HorizontalAlignment="Center" Width="300" Margin="5">
2024-12-02 10:04:59 +00:00
<ComboBox.ItemTemplate>
<DataTemplate>
2024-12-04 18:00:36 +00:00
<TextBlock Text="{Binding Name}" />
2024-12-02 10:04:59 +00:00
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
2024-12-04 18:00:36 +00:00
<!-- Второй ComboBox для выбора способа сортировки -->
2024-12-16 04:10:04 +00:00
<ComboBox Foreground="Black" ItemsSource="{Binding SortOptions}" SelectedItem="{Binding SelectedSortOption}" HorizontalAlignment="Center" Width="300" Margin="10">
2024-12-04 18:00:36 +00:00
<ComboBox.ItemTemplate>
2024-12-02 10:04:59 +00:00
<DataTemplate>
2024-12-04 18:00:36 +00:00
<TextBlock Text="{Binding}" />
2024-12-02 10:04:59 +00:00
</DataTemplate>
2024-12-04 18:00:36 +00:00
</ComboBox.ItemTemplate>
</ComboBox>
2024-12-16 04:10:04 +00:00
<StackPanel DockPanel.Dock="Bottom" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20">
<Button Foreground="Black" Content="Удалить всех студентов" Command="{Binding RemoveAllStudentsCommand}" HorizontalAlignment="Center" Width="250" Margin="10"/>
<Button Foreground="Black" Content="Добавить студента" Command="{Binding AddStudentCommand}" HorizontalAlignment="Center" Width="250" Margin="10"/>
</StackPanel>
2024-12-04 18:00:36 +00:00
</StackPanel>
<!-- Центральная панель для списка студентов -->
2024-12-16 04:10:04 +00:00
<ListBox ItemsSource="{Binding Users}"
HorizontalAlignment="Center"
Width="350"
Background="Bisque"
Margin="10"
SelectionMode="Multiple"
SelectedItems="{Binding SelectedUsers}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="5">
<TextBlock Foreground="Black" Text="{Binding Name}" VerticalAlignment="Center" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
2024-11-24 18:05:17 +00:00
2024-12-16 04:10:04 +00:00
<ListBox.ContextMenu>
<ContextMenu>
<MenuItem Header="Удалить" Click="OnDeleteUserClick"/>
<MenuItem Header="Редактировать" Click="OnEditUserClick"/>
</ContextMenu>
</ListBox.ContextMenu>
</ListBox>
2024-12-04 18:00:36 +00:00
</DockPanel>
2024-11-24 18:05:17 +00:00
</Window>
2024-12-16 04:10:04 +00:00