semesterWork/Presence.Desktop/Views/GroupView.axaml

83 lines
3.0 KiB
Plaintext
Raw Normal View History

2024-12-12 18:16:01 +00:00
<Window xmlns="https://github.com/avaloniaui"
2024-12-08 15:00:30 +00:00
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="using:Presence.Desktop.ViewModels"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
2024-12-08 15:27:37 +00:00
x:Class="Presence.Desktop.Views.GroupView"
2024-12-08 15:00:30 +00:00
x:DataType="vm:GroupViewModel">
<Design.DataContext>
2024-12-12 18:16:01 +00:00
<!-- This only sets the DataContext for the previewer in an IDE,
to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) -->
2024-12-08 15:00:30 +00:00
<vm:GroupViewModel/>
</Design.DataContext>
2024-12-12 18:16:01 +00:00
<DockPanel>
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Margin="10">
<TextBlock Text="Group:" VerticalAlignment="Center" Margin="0,0,5,0" />
<ComboBox ItemsSource="{Binding Groups}"
SelectedItem="{Binding SelectedGroupItem}"
Width="200" Margin="0,0,10,0">
2024-12-08 15:00:30 +00:00
<ComboBox.ItemTemplate>
<DataTemplate>
2024-12-12 18:16:01 +00:00
<TextBlock Text="{Binding GroupName}" />
2024-12-08 15:00:30 +00:00
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
2024-12-12 18:16:01 +00:00
<TextBlock Text="Sort:" VerticalAlignment="Center" Margin="0,0,5,0" />
<ComboBox ItemsSource="{Binding SortingOptions}"
SelectedItem="{Binding SelectedSortingOption}"
Width="200" Margin="0,0,10,0" />
<Button Content="Remove all"
Command="{Binding RemoveAllStudentsCommand}"
Margin="10,0,0,0" />
<Button Content="Import students"
Command="{Binding ImportStudentsCommand}"
Margin="10,0,0,0"/>
2024-12-13 05:47:52 +00:00
<Button Content="Swap to presences"
Click="SwapToPresences"
Margin="10,0,0,0"/>
2024-12-08 15:00:30 +00:00
</StackPanel>
2024-12-12 18:16:01 +00:00
<Border BorderBrush="Gray" BorderThickness="1" Margin="10" CornerRadius="5">
<ListBox ItemsSource="{Binding Students}"
SelectionMode="Multiple"
SelectedItems="{Binding SelectedStudents}"
SelectionChanged="SelectingItemsControl_OnSelectionChanged"
BorderThickness="0">
2024-12-08 15:00:30 +00:00
<ListBox.ItemTemplate>
<DataTemplate>
2024-12-12 18:16:01 +00:00
<StackPanel Orientation="Horizontal" Margin="5">
<TextBlock Text="{Binding FirstName}" FontWeight="Bold" Margin="0,0,10,0" />
<TextBlock Text="{Binding LastName}" FontWeight="Bold" Margin="0,0,10,0" />
<TextBlock Text="{Binding Patronymic}" FontWeight="Bold" Margin="0,0,10,0" />
2024-12-08 15:00:30 +00:00
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
2024-12-12 18:16:01 +00:00
<ListBox.ContextMenu>
<ContextMenu>
<MenuItem Header="Delete selected students"
Command="{Binding RemoveSelectedStudentsCommand}"
IsVisible="{Binding IsMultipleSelection}"
/>
<MenuItem Header="Remove"
Command="{Binding RemoveSelectedStudentsCommand}"
IsVisible="{Binding IsSingleSelection}"
/>
<MenuItem Header="Edit"
IsVisible="{Binding IsSingleSelection}"/>
</ContextMenu>
</ListBox.ContextMenu>
2024-12-08 15:00:30 +00:00
</ListBox>
</Border>
</DockPanel>
2024-12-12 18:16:01 +00:00
</Window>