Files
LehrerApp/LehrerApp.Desktop/Views/Dashboard/DashboardView.axaml.cs
T
adminandClaude Sonnet 5 ba52109eaa
CI / build-and-test (push) Canceled after 0s
feat: Untis-Hub für WebUntis-Sync-Gesundheitsstatus
Zeigt die Fälligkeit der vier bestehenden, manuell ausgelösten WebUntis-Abgleiche
(Fehlzeiten je Lerngruppe, offene Stunden, Klassenbuch-, Hausaufgabenabgleich) in
einem neuen Hub-Fenster, ohne selbst WebUntis anzufragen - nur gespeicherte
Zeitstempel werden ausgewertet. Konsolidiert die bisher verstreuten Einstiegspunkte
(Sidebar-Button, Dashboard-Buttons) in ein neues WebUntis-Menü plus einen
kompakten Gesundheits-Indikator auf dem Dashboard.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-10 23:41:12 +02:00

38 lines
1.2 KiB
C#

using Avalonia.Controls;
using Avalonia.Interactivity;
using LehrerApp.Core.Models;
using LehrerApp.Desktop.Services;
using LehrerApp.Desktop.ViewModels;
using LehrerApp.Desktop.Views.UntisHub;
using LehrerApp.Desktop.Views.Workload;
using Microsoft.Extensions.DependencyInjection;
namespace LehrerApp.Desktop.Views.Dashboard;
public partial class DashboardView : UserControl
{
public DashboardView() => InitializeComponent();
protected override void OnDataContextChanged(EventArgs e)
{
base.OnDataContextChanged(e);
if (DataContext is DashboardViewModel vm)
vm.OnAddTask = ShowAddTaskDialog;
}
private async Task<WorkTask?> ShowAddTaskDialog(bool startAsReminder)
{
var owner = TopLevel.GetTopLevel(this) as Window;
if (owner is null) return null;
return await WorkTaskDialogHelper.ShowDialog(owner, startAsReminder: startAsReminder);
}
private async void OnOpenUntisHubClick(object? sender, RoutedEventArgs e)
{
var owner = TopLevel.GetTopLevel(this) as Window;
if (owner is null) return;
await new UntisHubDialog().ShowDialog(owner);
if (DataContext is DashboardViewModel vm) vm.RefreshWebUntisHealth();
}
}