using Avalonia.Controls; using Avalonia.Input.Platform; using Avalonia.Interactivity; using LehrerApp.Desktop.Services; using LehrerApp.Desktop.ViewModels.Students; using Microsoft.Extensions.DependencyInjection; namespace LehrerApp.Desktop.Views.Students; public partial class WebUntisDocumentationComparisonDialog : Window { public WebUntisDocumentationComparisonDialog() => InitializeComponent(); private void OnClose(object? sender, RoutedEventArgs e) => Close(); private async void OnCopyToClipboardClick(object? sender, RoutedEventArgs e) { if (sender is not Button { DataContext: LocalOnlyDocumentationRow row }) return; var clipboard = TopLevel.GetTopLevel(this)?.Clipboard; if (clipboard is null) return; await clipboard.SetTextAsync(row.ClipboardText); App.Services.GetRequiredService().ShowSuccess("In die Zwischenablage kopiert."); } }