83 lines
3.0 KiB
XML
83 lines
3.0 KiB
XML
<Window xmlns="https://github.com/avaloniaui"
|
|
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"
|
|
x:Class="Presence.Desktop.Views.GroupView"
|
|
x:DataType="vm:GroupViewModel">
|
|
|
|
<Design.DataContext>
|
|
<!-- 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) -->
|
|
<vm:GroupViewModel/>
|
|
</Design.DataContext>
|
|
|
|
<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">
|
|
<ComboBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding GroupName}" />
|
|
</DataTemplate>
|
|
</ComboBox.ItemTemplate>
|
|
</ComboBox>
|
|
|
|
<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"/>
|
|
|
|
<Button Content="Swap to presences"
|
|
Click="SwapToPresences"
|
|
Margin="10,0,0,0"/>
|
|
</StackPanel>
|
|
|
|
<Border BorderBrush="Gray" BorderThickness="1" Margin="10" CornerRadius="5">
|
|
<ListBox ItemsSource="{Binding Students}"
|
|
SelectionMode="Multiple"
|
|
SelectedItems="{Binding SelectedStudents}"
|
|
SelectionChanged="SelectingItemsControl_OnSelectionChanged"
|
|
BorderThickness="0">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<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" />
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
|
|
<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>
|
|
</ListBox>
|
|
</Border>
|
|
</DockPanel>
|
|
</Window>
|