Stundenplan: Dropdown für Unterrichtsansicht/Sitzplan/Planung/Planungsviewer
Die zwei Buttons in der "Heute"-Tagesliste mit teils vom Lesson-Status
abhängiger Doppelbedeutung ("Verlaufsplan ansehen"/"Zur Lerngruppe") waren
unklar. Ersetzt durch ein Dropdown mit vier ausdrücklich benannten Zielen;
drei nutzen bestehende Commands, "Sitzplan" (Sitzpläne-Tab) ist neu und
bisher nur indirekt über den Unterrichtsmodus erreichbar gewesen.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -111,17 +111,24 @@
|
||||
Foreground="#8E6C00" FontWeight="SemiBold"
|
||||
IsVisible="{Binding HasUnhandledHomework}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="3" Orientation="Horizontal" Spacing="6" VerticalAlignment="Center">
|
||||
<Button Content="▶ Unterricht" FontSize="11" Padding="9,4"
|
||||
IsVisible="{Binding HasLesson}"
|
||||
ToolTip.Tip="Unterrichtsmodus: Verlaufsplan und Sitzplan mit Schnellbewertung auf einem Bildschirm."
|
||||
Command="{Binding $parent[ItemsControl].((vm:TimetableViewModel)DataContext).StartTeachingModeCommand}"
|
||||
CommandParameter="{Binding}"/>
|
||||
<Button Content="{Binding OpenButtonLabel}" FontSize="11" Padding="9,4"
|
||||
IsVisible="{Binding HasGroupId}"
|
||||
Command="{Binding $parent[ItemsControl].((vm:TimetableViewModel)DataContext).OpenTodayLessonCommand}"
|
||||
CommandParameter="{Binding}"/>
|
||||
</StackPanel>
|
||||
<!-- Nutzer-Feedback: unklar, wie man aus der Tagesliste zwischen
|
||||
Unterrichtsansicht/Sitzplan/Planung/Planungsviewer wechselt — jetzt
|
||||
ein Dropdown mit ausdrücklich benannten Zielen statt zweier Buttons
|
||||
mit vom Lesson-Status abhängiger Doppelbedeutung. Wiring/Routing in
|
||||
TimetableView.axaml.cs (SelectionChanged setzt die Auswahl danach
|
||||
bewusst zurück auf null — Menü-Charakter, keine dauerhafte
|
||||
Auswahl). -->
|
||||
<ComboBox Grid.Column="3" FontSize="11" MinWidth="150" VerticalAlignment="Center"
|
||||
IsVisible="{Binding HasDestinationOptions}"
|
||||
PlaceholderText="Öffnen ▾"
|
||||
ItemsSource="{Binding DestinationOptions}"
|
||||
SelectionChanged="OnLessonDestinationSelected">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate x:DataType="vm:TimetableDestinationOption">
|
||||
<TextBlock Text="{Binding Label}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
|
||||
@@ -2,6 +2,7 @@ using Avalonia.Controls;
|
||||
using LehrerApp.Core.Interfaces;
|
||||
using LehrerApp.Core.Models;
|
||||
using LehrerApp.Core.Services;
|
||||
using LehrerApp.Desktop.ViewModels;
|
||||
using LehrerApp.Desktop.ViewModels.Planning;
|
||||
using LehrerApp.Desktop.ViewModels.Groups;
|
||||
using LehrerApp.Desktop.Views.Groups;
|
||||
@@ -27,6 +28,39 @@ public partial class TimetableView : UserControl
|
||||
}
|
||||
}
|
||||
|
||||
/// Nutzer-Feedback: unklar, wie man aus der "Heute"-Tagesliste zwischen Unterrichtsansicht,
|
||||
/// Sitzplan, Planung und Planungsviewer wechselt. Statt der bisherigen zwei Buttons mit
|
||||
/// teils vom Lesson-Status abhängiger Doppelbedeutung ein Dropdown mit ausdrücklich benannten
|
||||
/// Zielen (TodayLessonItem.DestinationOptions) — Menü-Charakter, die Auswahl wird danach
|
||||
/// bewusst zurückgesetzt statt dauerhaft angezeigt. Drei der vier Ziele nutzen unverändert
|
||||
/// die bestehenden TimetableViewModel-Commands, nur "Sitzplan" ist neu (bisher nur über den
|
||||
/// Unterrichtsmodus erreichbar, siehe TODO.md 4.5.23-Nachtrag).
|
||||
private void OnLessonDestinationSelected(object? sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (sender is not ComboBox comboBox) return;
|
||||
var item = comboBox.DataContext as TodayLessonItem;
|
||||
var option = e.AddedItems.Count > 0 ? e.AddedItems[0] as TimetableDestinationOption : null;
|
||||
comboBox.SelectedItem = null;
|
||||
if (item is null || option is null || DataContext is not TimetableViewModel vm) return;
|
||||
|
||||
switch (option.Kind)
|
||||
{
|
||||
case TimetableLessonDestination.TeachingMode:
|
||||
vm.StartTeachingModeCommand.Execute(item);
|
||||
break;
|
||||
case TimetableLessonDestination.Viewer:
|
||||
vm.OpenTodayLessonCommand.Execute(item);
|
||||
break;
|
||||
case TimetableLessonDestination.Planning:
|
||||
vm.OpenGroupCommand.Execute(item.GroupId);
|
||||
break;
|
||||
case TimetableLessonDestination.SeatingPlan:
|
||||
App.Services.GetRequiredService<MainWindowViewModel>()
|
||||
.NavigateToGroupDetail(item.GroupId, 2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ShowWebUntisTimetableDialog()
|
||||
{
|
||||
var owner = TopLevel.GetTopLevel(this) as Window;
|
||||
|
||||
Reference in New Issue
Block a user