csharpdeeb25a2 | 1 | using Avalonia.Controls; |
| 2 | using Avalonia.Input.Platform; |
| 3 | using Avalonia.Interactivity; |
| 4 | using Avalonia.VisualTree; |
| 5 | |
| 6 | namespace CascadeIDE.Views; |
| 7 | |
| 8 | public partial class HybridIndexMfdPageView : UserControl |
| 9 | { |
| 10 | public HybridIndexMfdPageView() |
| 11 | { |
| 12 | InitializeComponent(); |
| 13 | } |
| 14 | |
| 15 | private async void OnCopyErrorClick(object? sender, RoutedEventArgs e) |
| 16 | { |
| 17 | e.Handled = true; |
| 18 | if (DataContext is not ViewModels.MainWindowViewModel vm) |
| 19 | return; |
| 20 | var text = vm.HybridIndexLastErrorText; |
| 21 | if (string.IsNullOrWhiteSpace(text) || text == "—") |
| 22 | return; |
| 23 | var top = TopLevel.GetTopLevel(this); |
| 24 | if (top?.Clipboard is { } clip) |
| 25 | await clip.SetTextAsync(text); |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | |
View only · write via MCP/CIDE