Initial
This commit is contained in:
109
LehrerApp.Desktop/Views/Groups/AddGroupDialog.axaml
Normal file
109
LehrerApp.Desktop/Views/Groups/AddGroupDialog.axaml
Normal file
@@ -0,0 +1,109 @@
|
||||
<Window xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="clr-namespace:LehrerApp.Desktop.ViewModels.Groups"
|
||||
x:Class="LehrerApp.Desktop.Views.Groups.AddGroupDialog"
|
||||
x:DataType="vm:AddGroupDialogViewModel"
|
||||
Title="Neue Lerngruppe"
|
||||
Width="420" Height="480"
|
||||
CanResize="False"
|
||||
WindowStartupLocation="CenterOwner">
|
||||
|
||||
<Grid RowDefinitions="*,Auto" Margin="24">
|
||||
|
||||
<StackPanel Grid.Row="0" Spacing="16">
|
||||
|
||||
<TextBlock Text="Neue Lerngruppe anlegen"
|
||||
FontSize="18" FontWeight="SemiBold"/>
|
||||
|
||||
<!-- Name -->
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="Name *" FontSize="12" Opacity="0.7"/>
|
||||
<TextBox Text="{Binding Name}"
|
||||
Watermark="z.B. 10E, Q1 Chemie, 5a"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Fach -->
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="Fach" FontSize="12" Opacity="0.7"/>
|
||||
<TextBox Text="{Binding Subject}"
|
||||
Watermark="z.B. Chemie, Mathematik"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Typ und Klassenstufe nebeneinander -->
|
||||
<Grid ColumnDefinitions="*,12,*">
|
||||
<StackPanel Grid.Column="0" Spacing="4">
|
||||
<TextBlock Text="Typ" FontSize="12" Opacity="0.7"/>
|
||||
<ComboBox ItemsSource="{Binding GroupTypes}"
|
||||
SelectedItem="{Binding Type}"
|
||||
HorizontalAlignment="Stretch">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate DataType="vm:GroupTypeItem">
|
||||
<TextBlock Text="{Binding Label}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Column="2" Spacing="4">
|
||||
<TextBlock Text="Klassenstufe *" FontSize="12" Opacity="0.7"/>
|
||||
<NumericUpDown Value="{Binding GradeLevel}"
|
||||
Minimum="1" Maximum="13"
|
||||
FormatString="0"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Notensystem und Schuljahr -->
|
||||
<Grid ColumnDefinitions="*,12,*">
|
||||
<StackPanel Grid.Column="0" Spacing="4">
|
||||
<TextBlock Text="Notensystem" FontSize="12" Opacity="0.7"/>
|
||||
<ComboBox ItemsSource="{Binding GradingSystems}"
|
||||
SelectedItem="{Binding GradingSystem}"
|
||||
HorizontalAlignment="Stretch">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate DataType="vm:GradingSystemItem">
|
||||
<TextBlock Text="{Binding Label}" TextWrapping="Wrap"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Column="2" Spacing="4">
|
||||
<TextBlock Text="Schuljahr" FontSize="12" Opacity="0.7"/>
|
||||
<ComboBox ItemsSource="{Binding SchoolYears}"
|
||||
SelectedItem="{Binding SelectedSchoolYear}"
|
||||
HorizontalAlignment="Stretch"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Wochenstunden -->
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="Wochenstunden (optional)" FontSize="12" Opacity="0.7"/>
|
||||
<NumericUpDown Value="{Binding HoursPerWeek}"
|
||||
Minimum="1" Maximum="20"
|
||||
FormatString="0"
|
||||
AllowSpin="True"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Validierungsfehler -->
|
||||
<TextBlock Text="{Binding ValidationMessage}"
|
||||
Foreground="Red" FontSize="12"
|
||||
IsVisible="{Binding ValidationMessage,
|
||||
Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
<!-- ── Buttons ──────────────────────────────────────────────────────── -->
|
||||
<Grid Grid.Row="1" ColumnDefinitions="*,8,*" Margin="0,16,0,0">
|
||||
<Button Grid.Column="0"
|
||||
Content="Abbrechen"
|
||||
HorizontalAlignment="Stretch"
|
||||
Click="OnCancel"/>
|
||||
<Button Grid.Column="2"
|
||||
Content="Anlegen"
|
||||
HorizontalAlignment="Stretch"
|
||||
Click="OnSave"/>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Window>
|
||||
33
LehrerApp.Desktop/Views/Groups/AddGroupDialog.axaml.cs
Normal file
33
LehrerApp.Desktop/Views/Groups/AddGroupDialog.axaml.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
|
||||
namespace LehrerApp.Desktop.Views.Groups;
|
||||
|
||||
public partial class AddGroupDialog : Window
|
||||
{
|
||||
public bool Saved { get; private set; }
|
||||
|
||||
public AddGroupDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void OnSave(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is ViewModels.Groups.AddGroupDialogViewModel vm)
|
||||
{
|
||||
if (vm.SaveCommand.CanExecute(null))
|
||||
{
|
||||
vm.SaveCommand.Execute(null);
|
||||
if (vm.Result is not null)
|
||||
{
|
||||
Saved = true;
|
||||
Close(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnCancel(object? sender, RoutedEventArgs e) =>
|
||||
Close(false);
|
||||
}
|
||||
129
LehrerApp.Desktop/Views/Groups/GroupDetailView.axaml
Normal file
129
LehrerApp.Desktop/Views/Groups/GroupDetailView.axaml
Normal file
@@ -0,0 +1,129 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="clr-namespace:LehrerApp.Desktop.ViewModels.Groups"
|
||||
x:Class="LehrerApp.Desktop.Views.Groups.GroupDetailView"
|
||||
x:DataType="vm:GroupDetailViewModel">
|
||||
|
||||
<Grid RowDefinitions="Auto,Auto,*">
|
||||
|
||||
<!-- ── Header ──────────────────────────────────────────────────────── -->
|
||||
<Border Grid.Row="0" Padding="20,16"
|
||||
BorderBrush="{DynamicResource SystemControlForegroundBaseLowBrush}"
|
||||
BorderThickness="0,0,0,1">
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<StackPanel Grid.Column="0">
|
||||
<TextBlock Text="{Binding GroupTitle}"
|
||||
FontSize="22" FontWeight="SemiBold"/>
|
||||
<TextBlock FontSize="12" Opacity="0.5">
|
||||
<Run Text="{Binding StudentCount}"/>
|
||||
<Run Text="Schüler"/>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="8">
|
||||
<Button Content="+ Schüler"
|
||||
Command="{Binding AddStudentCommand}"/>
|
||||
<Button Content="+ Klausur"
|
||||
Command="{Binding AddExamCommand}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- ── Tab-Leiste ──────────────────────────────────────────────────── -->
|
||||
<Border Grid.Row="1"
|
||||
BorderBrush="{DynamicResource SystemControlForegroundBaseLowBrush}"
|
||||
BorderThickness="0,0,0,1"
|
||||
Padding="16,0">
|
||||
<StackPanel Orientation="Horizontal" Spacing="4">
|
||||
<Button Content="Übersicht"
|
||||
Command="{Binding SwitchTabCommand}"
|
||||
CommandParameter="{x:Static vm:GroupTab.Overview}"
|
||||
Classes.active="{Binding ActiveTab,
|
||||
Converter={x:Static ObjectConverters.Equal},
|
||||
ConverterParameter={x:Static vm:GroupTab.Overview}}"
|
||||
Background="Transparent" Padding="12,8"/>
|
||||
<Button Content="Schüler"
|
||||
Command="{Binding SwitchTabCommand}"
|
||||
CommandParameter="{x:Static vm:GroupTab.Students}"
|
||||
Classes.active="{Binding ActiveTab,
|
||||
Converter={x:Static ObjectConverters.Equal},
|
||||
ConverterParameter={x:Static vm:GroupTab.Students}}"
|
||||
Background="Transparent" Padding="12,8"/>
|
||||
<Button Content="Klausuren"
|
||||
Command="{Binding SwitchTabCommand}"
|
||||
CommandParameter="{x:Static vm:GroupTab.Exams}"
|
||||
Classes.active="{Binding ActiveTab,
|
||||
Converter={x:Static ObjectConverters.Equal},
|
||||
ConverterParameter={x:Static vm:GroupTab.Exams}}"
|
||||
Background="Transparent" Padding="12,8"/>
|
||||
<Button Content="Noten"
|
||||
Command="{Binding SwitchTabCommand}"
|
||||
CommandParameter="{x:Static vm:GroupTab.Grades}"
|
||||
Background="Transparent" Padding="12,8"/>
|
||||
<Button Content="Planung"
|
||||
Command="{Binding SwitchTabCommand}"
|
||||
CommandParameter="{x:Static vm:GroupTab.Planner}"
|
||||
Background="Transparent" Padding="12,8"/>
|
||||
<Button Content="Dokumentation"
|
||||
Command="{Binding SwitchTabCommand}"
|
||||
CommandParameter="{x:Static vm:GroupTab.Documentation}"
|
||||
Background="Transparent" Padding="12,8"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- ── Tab-Inhalt ──────────────────────────────────────────────────── -->
|
||||
<ScrollViewer Grid.Row="2" Padding="20">
|
||||
|
||||
<!-- Schülerliste -->
|
||||
<DataGrid ItemsSource="{Binding Students}"
|
||||
IsVisible="{Binding ActiveTab,
|
||||
Converter={x:Static ObjectConverters.Equal},
|
||||
ConverterParameter={x:Static vm:GroupTab.Students}}"
|
||||
AutoGenerateColumns="False"
|
||||
IsReadOnly="True"
|
||||
GridLinesVisibility="Horizontal"
|
||||
CanUserReorderColumns="False"
|
||||
CanUserResizeColumns="True">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Name"
|
||||
Binding="{Binding FullName}"
|
||||
Width="*"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<!-- Klausuren -->
|
||||
<DataGrid ItemsSource="{Binding Exams}"
|
||||
IsVisible="{Binding ActiveTab,
|
||||
Converter={x:Static ObjectConverters.Equal},
|
||||
ConverterParameter={x:Static vm:GroupTab.Exams}}"
|
||||
AutoGenerateColumns="False"
|
||||
IsReadOnly="True"
|
||||
GridLinesVisibility="Horizontal"
|
||||
CanUserReorderColumns="False">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Datum"
|
||||
Binding="{Binding Date}"
|
||||
Width="100"/>
|
||||
<DataGridTextColumn Header="Titel"
|
||||
Binding="{Binding Title}"
|
||||
Width="*"/>
|
||||
<DataGridTextColumn Header="Status"
|
||||
Binding="{Binding Status}"
|
||||
Width="120"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<!-- Übersicht (Platzhalter) -->
|
||||
<StackPanel IsVisible="{Binding ActiveTab,
|
||||
Converter={x:Static ObjectConverters.Equal},
|
||||
ConverterParameter={x:Static vm:GroupTab.Overview}}"
|
||||
Spacing="12">
|
||||
<TextBlock Text="Übersicht" FontSize="16" FontWeight="SemiBold"/>
|
||||
<TextBlock Text="Hier erscheint eine Zusammenfassung der Lerngruppe."
|
||||
Opacity="0.5"/>
|
||||
</StackPanel>
|
||||
|
||||
</ScrollViewer>
|
||||
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
100
LehrerApp.Desktop/Views/Groups/GroupListView.axaml
Normal file
100
LehrerApp.Desktop/Views/Groups/GroupListView.axaml
Normal file
@@ -0,0 +1,100 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="clr-namespace:LehrerApp.Desktop.ViewModels.Groups"
|
||||
x:Class="LehrerApp.Desktop.Views.Groups.GroupListView"
|
||||
x:DataType="vm:GroupListViewModel">
|
||||
|
||||
<Grid RowDefinitions="Auto,*">
|
||||
|
||||
<!-- ── Toolbar ─────────────────────────────────────────────────────── -->
|
||||
<Border Grid.Row="0" Padding="20,16"
|
||||
BorderBrush="{DynamicResource SystemControlForegroundBaseLowBrush}"
|
||||
BorderThickness="0,0,0,1">
|
||||
<Grid ColumnDefinitions="*,Auto,Auto">
|
||||
|
||||
<StackPanel Grid.Column="0">
|
||||
<TextBlock Text="Lerngruppen" FontSize="22" FontWeight="SemiBold"/>
|
||||
<TextBlock FontSize="12" Opacity="0.5">
|
||||
<Run Text="{Binding Groups.Count}"/>
|
||||
<Run Text="Gruppen ·"/>
|
||||
<Run Text="{Binding SelectedSchoolYear}"/>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Schuljahr-Auswahl -->
|
||||
<ComboBox Grid.Column="1"
|
||||
ItemsSource="{Binding SchoolYears}"
|
||||
SelectedItem="{Binding SelectedSchoolYear}"
|
||||
Width="100" Margin="0,0,8,0"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
<!-- Neue Gruppe -->
|
||||
<Button Grid.Column="2"
|
||||
Content="+ Neue Gruppe"
|
||||
Command="{Binding AddGroupCommand}"
|
||||
VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- ── Inhalt ──────────────────────────────────────────────────────── -->
|
||||
<Grid Grid.Row="1" ColumnDefinitions="260,*">
|
||||
|
||||
<!-- Suchliste links -->
|
||||
<Border Grid.Column="0"
|
||||
BorderBrush="{DynamicResource SystemControlForegroundBaseLowBrush}"
|
||||
BorderThickness="0,0,1,0">
|
||||
<DockPanel>
|
||||
<TextBox DockPanel.Dock="Top"
|
||||
Text="{Binding SearchText}"
|
||||
Watermark="Suchen…"
|
||||
Margin="12,8"/>
|
||||
<ListBox ItemsSource="{Binding Groups}"
|
||||
SelectedItem="{Binding SelectedGroup}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate DataType="vm:GroupListItem">
|
||||
<Grid ColumnDefinitions="4,*" Margin="0,4">
|
||||
<Border Grid.Column="0" Width="4" CornerRadius="2"
|
||||
Background="{DynamicResource SystemAccentColor}"
|
||||
Margin="0,0,10,0"/>
|
||||
<StackPanel Grid.Column="1">
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="{Binding Name}"
|
||||
FontWeight="SemiBold" FontSize="13"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Text="{Binding TypeLabel}"
|
||||
FontSize="11" Opacity="0.5"/>
|
||||
</Grid>
|
||||
<TextBlock Text="{Binding Subject}"
|
||||
FontSize="12" Opacity="0.65"
|
||||
IsVisible="{Binding Subject,
|
||||
Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||||
<TextBlock Text="{Binding GradingLabel}"
|
||||
FontSize="11" Opacity="0.4"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Detail rechts – Platzhalter bis Gruppe gewählt -->
|
||||
<Border Grid.Column="1">
|
||||
<StackPanel HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Spacing="8"
|
||||
IsVisible="{Binding !SelectedGroup}">
|
||||
<TextBlock Text="Keine Gruppe ausgewählt"
|
||||
FontSize="16" Opacity="0.4"
|
||||
HorizontalAlignment="Center"/>
|
||||
<TextBlock Text="Wähle eine Gruppe aus der Liste oder lege eine neue an."
|
||||
FontSize="12" Opacity="0.3"
|
||||
HorizontalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
13
LehrerApp.Desktop/Views/Groups/GroupViews.cs
Normal file
13
LehrerApp.Desktop/Views/Groups/GroupViews.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace LehrerApp.Desktop.Views.Groups;
|
||||
|
||||
public partial class GroupListView : UserControl
|
||||
{
|
||||
public GroupListView() => InitializeComponent();
|
||||
}
|
||||
|
||||
public partial class GroupDetailView : UserControl
|
||||
{
|
||||
public GroupDetailView() => InitializeComponent();
|
||||
}
|
||||
Reference in New Issue
Block a user