Presence_Desktop/Presence.Desktop/Views/PresenceView.axaml
2024-12-23 14:26:41 +03:00

63 lines
2.7 KiB
XML
Raw Permalink 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: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.PresenceView"
x:DataType="vm:PresenceViewModel">
<Grid Margin="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<!-- Для DataGrid, ширина автоматически подстраивается -->
<ColumnDefinition Width="250" />
<!-- Для Calendar, уменьшенная ширина -->
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<!-- Для StackPanel с ComboBox -->
<RowDefinition Height="*" />
<!-- Для DataGrid и Calendar -->
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Grid.Row="0" Grid.ColumnSpan="2" Spacing="10">
<!-- Выбор группы -->
<ComboBox ItemsSource="{Binding Groups}" SelectedItem="{Binding SelectedGroup}" Width="200" PlaceholderText="Выберите группу">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</StackPanel>
<!-- Создаем новую строку для DataGrid и Calendar -->
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<!-- Для DataGrid, ширина автоматически подстраивается -->
<ColumnDefinition Width="100" />
<!-- Для Calendar, уменьшенная ширина -->
</Grid.ColumnDefinitions>
<!-- Таблица с посещаемостью слева -->
<DataGrid Grid.Column="0" AutoGenerateColumns="False" ItemsSource="{Binding AttendanceRecords}" CanUserSortColumns="True">
<DataGrid.Columns>
<DataGridTextColumn Header="Дата" Binding="{Binding Date}" />
<DataGridTextColumn Header="Номер урока" Binding="{Binding LessonNumber}" />
<DataGridTextColumn Header="ФИО" Binding="{Binding UserGuid}" />
<!-- Тип посещаемости -->
<DataGridCheckBoxColumn Header="Тип посещаемости" Binding="{Binding IsAttedance, Mode=TwoWay}" />
</DataGrid.Columns>
</DataGrid>
<!-- Календарь справа с уменьшенной шириной -->
<Calendar SelectedDate="{Binding SelectedDate}" Width="350" Height="300" Grid.Column="1" Margin="10" />
</Grid>
</Grid>
</UserControl>