using Avalonia.Controls; using Avalonia.Interactivity; using Avalonia.Platform.Storage; using ClaudeDo.Ui.ViewModels; namespace ClaudeDo.Ui.Views; public partial class TaskEditorView : Window { public TaskEditorView() { InitializeComponent(); } private async void OnBrowseAgent(object? sender, RoutedEventArgs e) { var files = await StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions { Title = "Select Agent File", AllowMultiple = false, FileTypeFilter = new[] { new FilePickerFileType("Agent Files") { Patterns = ["*.md"] } }, }); if (files.Count == 0) return; var path = files[0].TryGetLocalPath(); if (path is null) return; if (DataContext is TaskEditorViewModel vm) vm.SetAgentFromPath(path); } }