"Vorgang": Fallmappe für Klassenbuch- und Dokumentationseinträge
CI / build-and-test (push) Canceled after 0s
CI / build-and-test (push) Canceled after 0s
Neuer 4. Tab in der Klassenlehreransicht: bündelt Titel, Beschreibung, Schlagwörter, verknüpfte Dokumentation und angeheftete (eingefrorene) WebUntis-Klassenbucheinträge zu einem laufenden Problem mit einer/einem oder mehreren Schüler*innen. Anheften direkt aus dem Klassenbuch-Tab per Rechtsklick. Sync-fähig nach dem bestehenden Documentation-Muster. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,187 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="clr-namespace:LehrerApp.Desktop.ViewModels.ClassTeacher"
|
||||
xmlns:svm="clr-namespace:LehrerApp.Desktop.ViewModels.Students"
|
||||
x:Class="LehrerApp.Desktop.Views.ClassTeacher.ClassTeacherCasesView"
|
||||
x:DataType="vm:ClassTeacherCasesViewModel">
|
||||
|
||||
<UserControl.Styles>
|
||||
<Style Selector="Border.statusPill">
|
||||
<Setter Property="CornerRadius" Value="10"/>
|
||||
<Setter Property="Padding" Value="8,2"/>
|
||||
</Style>
|
||||
<Style Selector="Border.statusPill.open">
|
||||
<Setter Property="Background" Value="#FB8C00"/>
|
||||
</Style>
|
||||
<Style Selector="Border.statusPill.closed">
|
||||
<Setter Property="Background" Value="#43A047"/>
|
||||
</Style>
|
||||
<Style Selector="Border.statusPill TextBlock">
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="FontSize" Value="11"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
</Style>
|
||||
</UserControl.Styles>
|
||||
|
||||
<Grid RowDefinitions="Auto,Auto,*" Margin="16" RowSpacing="10">
|
||||
<Grid Grid.Row="0" ColumnDefinitions="*,Auto,Auto">
|
||||
<StackPanel Grid.Column="0">
|
||||
<TextBlock Text="Vorgänge" FontSize="22" FontWeight="SemiBold"/>
|
||||
<TextBlock Text="Fallmappen für laufende Probleme mit einer/einem oder mehreren Schüler*innen der Klasse"
|
||||
FontSize="12" Opacity="0.55"/>
|
||||
</StackPanel>
|
||||
<CheckBox Grid.Column="1" Content="Nur offene" IsChecked="{Binding OnlyOpen}"
|
||||
VerticalAlignment="Center" Margin="0,0,12,0"/>
|
||||
<Button Grid.Column="2" Content="+ Vorgang" Command="{Binding AddVorgangCommand}"/>
|
||||
</Grid>
|
||||
|
||||
<TextBlock Grid.Row="1" Text="{Binding Status}" FontSize="11" Opacity="0.6"/>
|
||||
|
||||
<ScrollViewer Grid.Row="2">
|
||||
<StackPanel>
|
||||
<ItemsControl ItemsSource="{Binding Cases}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="vm:VorgangItem">
|
||||
<Border Background="{DynamicResource AppCardBackgroundBrush}"
|
||||
BorderBrush="{DynamicResource AppCardBorderBrush}" BorderThickness="1"
|
||||
CornerRadius="8" Padding="12,10" Margin="0,0,0,8">
|
||||
<StackPanel Spacing="8">
|
||||
<Grid ColumnDefinitions="*,Auto,Auto,Auto,Auto,Auto">
|
||||
<StackPanel Grid.Column="0">
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<Border Classes="statusPill" Classes.open="{Binding IsOpen}" Classes.closed="{Binding !IsOpen}">
|
||||
<TextBlock Text="{Binding StatusLabel}"/>
|
||||
</Border>
|
||||
<TextBlock Text="{Binding Model.Title}" FontWeight="SemiBold" FontSize="14"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding StudentNames}" FontSize="12" Opacity="0.7" Margin="0,2,0,0"/>
|
||||
<ItemsControl ItemsSource="{Binding TagChips}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate><WrapPanel ItemSpacing="6" LineSpacing="4"/></ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="svm:TagChip">
|
||||
<Border Background="{Binding ColorHex}" CornerRadius="10" Padding="8,2" Margin="0,4,0,0">
|
||||
<TextBlock Text="{Binding Text}" FontSize="10" Foreground="White"/>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
||||
<Button Content="Details anzeigen" FontSize="11" Padding="8,3"
|
||||
Command="{Binding RevealCommand}" IsVisible="{Binding !IsRevealed}"/>
|
||||
<Button Content="Details ausblenden" FontSize="11" Padding="8,3"
|
||||
Command="{Binding RevealCommand}" IsVisible="{Binding IsRevealed}"/>
|
||||
</StackPanel>
|
||||
<Button Grid.Column="2" Content="Bearbeiten" FontSize="11" Padding="8,3"
|
||||
Command="{Binding $parent[ItemsControl].((vm:ClassTeacherCasesViewModel)DataContext).EditVorgangCommand}"
|
||||
CommandParameter="{Binding}"/>
|
||||
<StackPanel Grid.Column="3" Orientation="Horizontal">
|
||||
<Button Content="Schließen" FontSize="11" Padding="8,3" IsVisible="{Binding IsOpen}"
|
||||
Command="{Binding $parent[ItemsControl].((vm:ClassTeacherCasesViewModel)DataContext).ToggleStatusCommand}"
|
||||
CommandParameter="{Binding}"/>
|
||||
<Button Content="Wieder öffnen" FontSize="11" Padding="8,3" IsVisible="{Binding !IsOpen}"
|
||||
Command="{Binding $parent[ItemsControl].((vm:ClassTeacherCasesViewModel)DataContext).ToggleStatusCommand}"
|
||||
CommandParameter="{Binding}"/>
|
||||
</StackPanel>
|
||||
<Button Grid.Column="4" Content="Löschen" FontSize="11" Padding="8,3"
|
||||
Command="{Binding $parent[ItemsControl].((vm:ClassTeacherCasesViewModel)DataContext).DeleteVorgangCommand}"
|
||||
CommandParameter="{Binding}"/>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Spacing="10" IsVisible="{Binding IsRevealed}" Margin="0,4,0,0">
|
||||
<TextBlock Text="{Binding Model.Description}" FontSize="12" TextWrapping="Wrap" Opacity="0.85"
|
||||
IsVisible="{Binding Model.Description, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||||
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="Verknüpfte Dokumentation" FontSize="12" FontWeight="SemiBold" Opacity="0.7"/>
|
||||
<ItemsControl ItemsSource="{Binding LinkedDocumentation}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="svm:DocumentationItem">
|
||||
<Grid ColumnDefinitions="70,*,Auto,Auto" Margin="0,2">
|
||||
<TextBlock Grid.Column="0" Text="{Binding DateDisplay}" FontSize="11" Opacity="0.5"/>
|
||||
<StackPanel Grid.Column="1">
|
||||
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||
<TextBlock Text="{Binding StudentName}" FontSize="12" FontWeight="SemiBold"/>
|
||||
<TextBlock Text="{Binding Model.Title}" FontSize="12" IsVisible="{Binding IsRevealed}"/>
|
||||
<TextBlock Text="Vertraulich" FontSize="12" Opacity="0.6" IsVisible="{Binding !IsRevealed}"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding TypeLabel}" FontSize="10" Opacity="0.5"/>
|
||||
</StackPanel>
|
||||
<Button Grid.Column="2" Content="Anzeigen" FontSize="10" Padding="6,2" Margin="0,0,4,0"
|
||||
Command="{Binding RevealCommand}" IsVisible="{Binding !IsRevealed}"/>
|
||||
<Button Grid.Column="3" Content="Entfernen" FontSize="10" Padding="6,2"
|
||||
Command="{Binding $parent[ItemsControl].((vm:VorgangItem)DataContext).UnlinkCommand}"
|
||||
CommandParameter="{Binding}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<TextBlock Text="Noch keine Dokumentation verknüpft." FontSize="11" Opacity="0.5"
|
||||
IsVisible="{Binding !HasLinkedDocumentation}"/>
|
||||
<Button Content="+ Neue Dokumentation anlegen" FontSize="11" Padding="8,3"
|
||||
HorizontalAlignment="Left"
|
||||
Command="{Binding $parent[ItemsControl].((vm:ClassTeacherCasesViewModel)DataContext).CreateAndLinkDocumentationCommand}"
|
||||
CommandParameter="{Binding}"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="4" IsVisible="{Binding HasAvailableDocumentation}">
|
||||
<TextBlock Text="Bestehende Dokumentation der Schüler*innen verknüpfen" FontSize="12"
|
||||
FontWeight="SemiBold" Opacity="0.7"/>
|
||||
<ItemsControl ItemsSource="{Binding AvailableDocumentation}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="svm:DocumentationItem">
|
||||
<Grid ColumnDefinitions="70,*,Auto,Auto" Margin="0,2">
|
||||
<TextBlock Grid.Column="0" Text="{Binding DateDisplay}" FontSize="11" Opacity="0.5"/>
|
||||
<StackPanel Grid.Column="1">
|
||||
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||
<TextBlock Text="{Binding StudentName}" FontSize="12" FontWeight="SemiBold"/>
|
||||
<TextBlock Text="{Binding Model.Title}" FontSize="12" IsVisible="{Binding IsRevealed}"/>
|
||||
<TextBlock Text="Vertraulich" FontSize="12" Opacity="0.6" IsVisible="{Binding !IsRevealed}"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding TypeLabel}" FontSize="10" Opacity="0.5"/>
|
||||
</StackPanel>
|
||||
<Button Grid.Column="2" Content="Anzeigen" FontSize="10" Padding="6,2" Margin="0,0,4,0"
|
||||
Command="{Binding RevealCommand}" IsVisible="{Binding !IsRevealed}"/>
|
||||
<Button Grid.Column="3" Content="Verknüpfen" FontSize="10" Padding="6,2"
|
||||
Command="{Binding $parent[ItemsControl].((vm:VorgangItem)DataContext).LinkCommand}"
|
||||
CommandParameter="{Binding}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="Angeheftete Klassenbucheinträge" FontSize="12" FontWeight="SemiBold" Opacity="0.7"/>
|
||||
<ItemsControl ItemsSource="{Binding ClassRegisterRows}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="vm:VorgangClassRegisterEntryRow">
|
||||
<Grid ColumnDefinitions="70,*,Auto" Margin="0,2">
|
||||
<TextBlock Grid.Column="0" Text="{Binding DateLabel}" FontSize="11" Opacity="0.5"/>
|
||||
<StackPanel Grid.Column="1">
|
||||
<TextBlock Text="{Binding StudentName}" FontSize="12" FontWeight="SemiBold"/>
|
||||
<TextBlock Text="{Binding SummaryLabel}" FontSize="11" Opacity="0.7" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
<Button Grid.Column="2" Content="Entfernen" FontSize="10" Padding="6,2"
|
||||
Command="{Binding $parent[ItemsControl].((vm:VorgangItem)DataContext).RemoveClassRegisterEntryCommand}"
|
||||
CommandParameter="{Binding}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<TextBlock Text="Noch keine Klassenbucheinträge angeheftet — im Klassenbuch-Tab über „→ Vorgang“ möglich."
|
||||
FontSize="11" Opacity="0.5" IsVisible="{Binding !HasClassRegisterRows}" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<TextBlock Text="Keine Vorgänge." Classes="emptyhint" IsVisible="{Binding !HasCases}"/>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,63 @@
|
||||
using Avalonia.Controls;
|
||||
using LehrerApp.Core.Interfaces;
|
||||
using LehrerApp.Core.Models;
|
||||
using LehrerApp.Desktop.ViewModels.ClassTeacher;
|
||||
using LehrerApp.Desktop.ViewModels.Students;
|
||||
using LehrerApp.Desktop.Views.Shared;
|
||||
using LehrerApp.Desktop.Views.Students;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace LehrerApp.Desktop.Views.ClassTeacher;
|
||||
|
||||
public partial class ClassTeacherCasesView : UserControl
|
||||
{
|
||||
public ClassTeacherCasesView() => InitializeComponent();
|
||||
|
||||
protected override void OnDataContextChanged(EventArgs e)
|
||||
{
|
||||
base.OnDataContextChanged(e);
|
||||
if (DataContext is not ClassTeacherCasesViewModel vm) return;
|
||||
vm.OnEditVorgang = ShowVorgangDialog;
|
||||
vm.OnConfirmDeleteVorgang = ShowDeleteVorgangDialog;
|
||||
vm.OnEditDocumentation = ShowDocumentationDialog;
|
||||
}
|
||||
|
||||
private async Task<Vorgang?> ShowVorgangDialog(List<StudentOption> rosterStudents, Vorgang? editing)
|
||||
{
|
||||
var owner = TopLevel.GetTopLevel(this) as Window;
|
||||
if (owner is null) return null;
|
||||
|
||||
var vm = new VorgangDialogViewModel(rosterStudents, editing);
|
||||
var dialog = new VorgangDialog { DataContext = vm };
|
||||
var saved = await dialog.ShowDialog<bool>(owner);
|
||||
return saved ? vm.Result : null;
|
||||
}
|
||||
|
||||
private async Task<bool> ShowDeleteVorgangDialog(VorgangItem item)
|
||||
{
|
||||
var info = new ConfirmDialogInfo
|
||||
{
|
||||
Title = "Vorgang löschen?",
|
||||
Message = $"\"{item.Model.Title}\" wird als gelöscht markiert und nicht mehr angezeigt. " +
|
||||
"Verknüpfte Dokumentation bleibt erhalten.",
|
||||
ConfirmText = "Löschen",
|
||||
};
|
||||
var dialog = new ConfirmDialog { DataContext = info };
|
||||
var owner = TopLevel.GetTopLevel(this) as Window;
|
||||
return owner is not null && await dialog.ShowDialog<bool>(owner);
|
||||
}
|
||||
|
||||
private async Task<Documentation?> ShowDocumentationDialog(
|
||||
Guid defaultStudentId, List<StudentOption> studentOptions, Documentation? editing)
|
||||
{
|
||||
var owner = TopLevel.GetTopLevel(this) as Window;
|
||||
if (owner is null) return null;
|
||||
|
||||
var vm = new DocumentationDialogViewModel(defaultStudentId, editing,
|
||||
App.Services.GetRequiredService<IAttachmentStorage>(), studentOptions);
|
||||
var dialog = new DocumentationDialog { DataContext = vm };
|
||||
var saved = await dialog.ShowDialog<bool>(owner);
|
||||
if (!saved) vm.DiscardUnsavedAttachments();
|
||||
return saved ? vm.Result : null;
|
||||
}
|
||||
}
|
||||
@@ -507,6 +507,9 @@
|
||||
<ContentPage Header="Fehlzeiten">
|
||||
<views:ClassTeacherAbsencesView DataContext="{Binding DetailsTab}"/>
|
||||
</ContentPage>
|
||||
<ContentPage Header="Vorgänge">
|
||||
<views:ClassTeacherCasesView DataContext="{Binding CasesTab}"/>
|
||||
</ContentPage>
|
||||
</TabbedPage>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -62,8 +62,8 @@
|
||||
<Grid Grid.Row="0" ColumnDefinitions="*,Auto">
|
||||
<StackPanel>
|
||||
<TextBlock Text="Klassenbuch" FontSize="22" FontWeight="SemiBold"/>
|
||||
<TextBlock Text="Einträge anderer Lehrkräfte – nur zur Ansicht" FontSize="12" Opacity="0.55"
|
||||
IsVisible="{Binding !ShowOwnDocumentation}"/>
|
||||
<TextBlock Text="Einträge anderer Lehrkräfte – nur zur Ansicht. Rechtsklick auf einen Eintrag heftet ihn an einen Vorgang an."
|
||||
FontSize="12" Opacity="0.55" IsVisible="{Binding !ShowOwnDocumentation}"/>
|
||||
<TextBlock Text="Eigene Dokumentation zu Schüler*innen dieser Klasse" FontSize="12" Opacity="0.55"
|
||||
IsVisible="{Binding ShowOwnDocumentation}"/>
|
||||
</StackPanel>
|
||||
@@ -147,7 +147,8 @@
|
||||
</Border>
|
||||
|
||||
<Grid Grid.Row="4" IsVisible="{Binding !ShowOwnDocumentation}">
|
||||
<DataGrid ItemsSource="{Binding Entries}" AutoGenerateColumns="False" IsReadOnly="True"
|
||||
<DataGrid ItemsSource="{Binding Entries}" SelectedItem="{Binding SelectedEntry, Mode=TwoWay}"
|
||||
AutoGenerateColumns="False" IsReadOnly="True"
|
||||
GridLinesVisibility="Horizontal" BorderBrush="{DynamicResource AppCardBorderBrush}" BorderThickness="1"
|
||||
CanUserResizeColumns="True" CanUserSortColumns="True" RowHeight="46">
|
||||
<DataGrid.Columns>
|
||||
@@ -159,6 +160,12 @@
|
||||
<DataGridTextColumn Header="Gruppe" Binding="{Binding CategoryGroup}" Width="0.8*"/>
|
||||
<DataGridTextColumn Header="Eintrag" Binding="{Binding Text}" Width="2*"/>
|
||||
</DataGrid.Columns>
|
||||
<DataGrid.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="→ An Vorgang anheften" Command="{Binding PinToVorgangCommand}"
|
||||
CommandParameter="{Binding SelectedEntry}"/>
|
||||
</ContextMenu>
|
||||
</DataGrid.ContextMenu>
|
||||
</DataGrid>
|
||||
<StackPanel IsVisible="{Binding !HasEntries}" HorizontalAlignment="Center" VerticalAlignment="Center" Spacing="5">
|
||||
<TextBlock Text="Keine Klassenbucheinträge im gewählten Zeitraum" FontWeight="SemiBold"/>
|
||||
|
||||
@@ -19,6 +19,21 @@ public partial class ClassTeacherRegisterView : UserControl
|
||||
if (DataContext is not ClassTeacherDetailsViewModel vm) return;
|
||||
vm.OnEditOwnDocumentation = ShowDocumentationDialog;
|
||||
vm.OnConfirmDeleteOwnDocumentation = ShowDeleteDocumentationDialog;
|
||||
vm.OnPickVorgangForPin = ShowPinToVorgangDialog;
|
||||
}
|
||||
|
||||
private async Task<PinToVorgangChoice?> ShowPinToVorgangDialog(ClassTeacherClassRegisterRow row)
|
||||
{
|
||||
if (DataContext is not ClassTeacherDetailsViewModel vm) return null;
|
||||
var owner = TopLevel.GetTopLevel(this) as Window;
|
||||
if (owner is null) return null;
|
||||
|
||||
var summary = $"{row.DateLabel} · {row.StudentDisplayName} · {row.CategoryName}";
|
||||
var matchingCases = vm.OpenCasesFor(row.StudentName);
|
||||
var dialogVm = new PinToVorgangDialogViewModel(summary, matchingCases);
|
||||
var dialog = new PinToVorgangDialog { DataContext = dialogVm };
|
||||
var confirmed = await dialog.ShowDialog<bool>(owner);
|
||||
return confirmed ? dialogVm.Result : null;
|
||||
}
|
||||
|
||||
private async Task<Documentation?> ShowDocumentationDialog(
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<Window xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="clr-namespace:LehrerApp.Desktop.ViewModels.ClassTeacher"
|
||||
x:Class="LehrerApp.Desktop.Views.ClassTeacher.PinToVorgangDialog"
|
||||
x:DataType="vm:PinToVorgangDialogViewModel"
|
||||
Title="An Vorgang anheften"
|
||||
Width="420" SizeToContent="Height" MinHeight="260"
|
||||
CanResize="True" WindowStartupLocation="CenterOwner">
|
||||
|
||||
<Grid RowDefinitions="*,Auto" Margin="24">
|
||||
<StackPanel Grid.Row="0" Spacing="12">
|
||||
<TextBlock Text="An Vorgang anheften" Classes="dialogtitle"/>
|
||||
<TextBlock Text="{Binding RowSummary}" FontSize="12" Opacity="0.6" TextWrapping="Wrap"/>
|
||||
|
||||
<StackPanel Spacing="4" IsVisible="{Binding HasMatchingOpenCases}">
|
||||
<TextBlock Text="Bestehenden offenen Vorgang wählen" FontSize="12" Opacity="0.7"/>
|
||||
<ComboBox ItemsSource="{Binding MatchingOpenCases}" SelectedItem="{Binding SelectedCase}"
|
||||
HorizontalAlignment="Stretch">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate x:DataType="vm:VorgangItem">
|
||||
<TextBlock Text="{Binding Model.Title}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Text="— oder —" FontSize="11" Opacity="0.5" HorizontalAlignment="Center"
|
||||
IsVisible="{Binding HasMatchingOpenCases}"/>
|
||||
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="Neuen Vorgang anlegen mit Titel" FontSize="12" Opacity="0.7"/>
|
||||
<TextBox Text="{Binding NewTitle}" PlaceholderText="z.B. Schuleschwänzen"/>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Text="{Binding Error}" Foreground="Red" FontSize="11"
|
||||
IsVisible="{Binding Error, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||||
</StackPanel>
|
||||
|
||||
<Grid Grid.Row="1" ColumnDefinitions="*,8,*" Margin="0,20,0,0">
|
||||
<Button Grid.Column="0" Content="Abbrechen" HorizontalAlignment="Stretch" Click="OnCancel"/>
|
||||
<Button Grid.Column="2" Content="Anheften" HorizontalAlignment="Stretch" Click="OnConfirm"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,21 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using LehrerApp.Desktop.ViewModels.ClassTeacher;
|
||||
|
||||
namespace LehrerApp.Desktop.Views.ClassTeacher;
|
||||
|
||||
public partial class PinToVorgangDialog : Window
|
||||
{
|
||||
public PinToVorgangDialog() => InitializeComponent();
|
||||
|
||||
private void OnConfirm(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is PinToVorgangDialogViewModel vm)
|
||||
{
|
||||
vm.ConfirmCommand.Execute(null);
|
||||
if (vm.Result is not null) Close(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnCancel(object? sender, RoutedEventArgs e) => Close(false);
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<Window xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="clr-namespace:LehrerApp.Desktop.ViewModels.ClassTeacher"
|
||||
x:Class="LehrerApp.Desktop.Views.ClassTeacher.VorgangDialog"
|
||||
x:DataType="vm:VorgangDialogViewModel"
|
||||
Title="{Binding DialogTitle}"
|
||||
Width="480" SizeToContent="Height" MinHeight="360"
|
||||
CanResize="True" WindowStartupLocation="CenterOwner">
|
||||
|
||||
<Grid RowDefinitions="*,Auto" Margin="24">
|
||||
<ScrollViewer Grid.Row="0">
|
||||
<StackPanel Spacing="12">
|
||||
<TextBlock Text="{Binding DialogTitle}" Classes="dialogtitle"/>
|
||||
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="Titel *" FontSize="12" Opacity="0.7"/>
|
||||
<TextBox Text="{Binding Title}"/>
|
||||
<TextBlock Text="{Binding TitleError}" Foreground="Red" FontSize="11"
|
||||
IsVisible="{Binding TitleError, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="Beschreibung" FontSize="12" Opacity="0.7"/>
|
||||
<TextBox Text="{Binding Description}" AcceptsReturn="True" Height="90" TextWrapping="Wrap"
|
||||
PlaceholderText="Worum geht es? Was ist bisher passiert?"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="6">
|
||||
<TextBlock Text="Schlagwörter" FontSize="12" Opacity="0.7"/>
|
||||
<ItemsControl ItemsSource="{Binding Tags}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate><WrapPanel ItemSpacing="6" LineSpacing="6"/></ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border Background="{DynamicResource SystemControlBackgroundBaseMediumBrush}"
|
||||
CornerRadius="10" Padding="8,3">
|
||||
<StackPanel Orientation="Horizontal" Spacing="5">
|
||||
<TextBlock Text="{Binding}" FontSize="11"/>
|
||||
<Button Content="×" FontSize="11" Padding="0" Background="Transparent"
|
||||
Command="{Binding $parent[ItemsControl].((vm:VorgangDialogViewModel)DataContext).RemoveTagCommand}"
|
||||
CommandParameter="{Binding}"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<Grid ColumnDefinitions="*,8,Auto">
|
||||
<AutoCompleteBox Grid.Column="0" Text="{Binding NewTag}"
|
||||
ItemsSource="{Binding TagSuggestions}"
|
||||
FilterMode="Contains" MinimumPrefixLength="0"
|
||||
PlaceholderText="Schlagwort (z.B. Absentismus)"/>
|
||||
<Button Grid.Column="2" Content="+" Command="{Binding AddTagCommand}"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="Betroffene Schüler*innen *" FontSize="12" Opacity="0.7"/>
|
||||
<ItemsControl ItemsSource="{Binding StudentOptions}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate><WrapPanel/></ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate x:DataType="vm:VorgangStudentOption">
|
||||
<CheckBox Content="{Binding Name}" IsChecked="{Binding IsSelected}" Margin="0,2,14,2"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<TextBlock Text="{Binding StudentsError}" Foreground="Red" FontSize="11"
|
||||
IsVisible="{Binding StudentsError, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
<Grid Grid.Row="1" ColumnDefinitions="*,8,*" Margin="0,20,0,0">
|
||||
<Button Grid.Column="0" Content="Abbrechen" HorizontalAlignment="Stretch" Click="OnCancel"/>
|
||||
<Button Grid.Column="2" Content="Speichern" HorizontalAlignment="Stretch" Click="OnSave"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,21 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using LehrerApp.Desktop.ViewModels.ClassTeacher;
|
||||
|
||||
namespace LehrerApp.Desktop.Views.ClassTeacher;
|
||||
|
||||
public partial class VorgangDialog : Window
|
||||
{
|
||||
public VorgangDialog() => InitializeComponent();
|
||||
|
||||
private void OnSave(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is VorgangDialogViewModel vm)
|
||||
{
|
||||
vm.SaveCommand.Execute(null);
|
||||
if (vm.Result is not null) Close(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnCancel(object? sender, RoutedEventArgs e) => Close(false);
|
||||
}
|
||||
Reference in New Issue
Block a user