{"kind":"AgentDefinition","metadata":{"namespace":"community","name":"dotnet-wpf","version":"0.1.0"},"spec":{"agents_md":"---\ndescription: '.NET WPF component and application patterns'\napplyTo: '**/*.xaml, **/*.cs'\n---\n\n## Summary\n\nThese instructions guide GitHub Copilot to assist with building high-quality, maintainable, and performant WPF applications using the MVVM pattern. It includes best practices for XAML, data binding, UI responsiveness, and .NET performance.\n\n## Ideal project types\n\n- Desktop applications using C# and WPF\n- Applications following the MVVM (Model-View-ViewModel) design pattern\n- Projects using .NET 8.0 or later\n- UI components built in XAML\n- Solutions emphasizing performance and responsiveness\n\n## Goals\n\n- Generate boilerplate for `INotifyPropertyChanged` and `RelayCommand`\n- Suggest clean separation of ViewModel and View logic\n- Encourage use of `ObservableCollection\u003cT\u003e`, `ICommand`, and proper binding\n- Recommend performance tips (e.g., virtualization, async loading)\n- Avoid tightly coupling code-behind logic\n- Produce testable ViewModels\n\n## Example prompt behaviors\n\n### ✅ Good Suggestions\n- \"Generate a ViewModel for a login screen with properties for username and password, and a LoginCommand\"\n- \"Write a XAML snippet for a ListView that uses UI virtualization and binds to an ObservableCollection\"\n- \"Refactor this code-behind click handler into a RelayCommand in the ViewModel\"\n- \"Add a loading spinner while fetching data asynchronously in WPF\"\n\n### ❌ Avoid\n- Suggesting business logic in code-behind\n- Using static event handlers without context\n- Generating tightly coupled XAML without binding\n- Suggesting WinForms or UWP approaches\n\n## Technologies to prefer\n- C# with .NET 8.0+\n- XAML with MVVM structure\n- `CommunityToolkit.Mvvm` or custom `RelayCommand` implementations\n- Async/await for non-blocking UI\n- `ObservableCollection`, `ICommand`, `INotifyPropertyChanged`\n\n## Common Patterns to Follow\n- ViewModel-first binding\n- Dependency Injection using .NET or third-party containers (e.g., Autofac, SimpleInjector)\n- XAML naming conventions (PascalCase for controls, camelCase for bindings)\n- Avoiding magic strings in binding (use `nameof`)\n\n## Sample Instruction Snippets Copilot Can Use\n\n```csharp\npublic class MainViewModel : ObservableObject\n{\n    [ObservableProperty]\n    private string userName;\n\n    [ObservableProperty]\n    private string password;\n\n    [RelayCommand]\n    private void Login()\n    {\n        // Add login logic here\n    }\n}\n```\n\n```xml\n\u003cStackPanel\u003e\n    \u003cTextBox Text=\"{Binding UserName, UpdateSourceTrigger=PropertyChanged}\" /\u003e\n    \u003cPasswordBox x:Name=\"PasswordBox\" /\u003e\n    \u003cButton Content=\"Login\" Command=\"{Binding LoginCommand}\" /\u003e\n\u003c/StackPanel\u003e\n```\n","description":".NET WPF component and application patterns","import":{"commit_sha":"541b7819d8c3545c6df122491af4fa1eae415779","imported_at":"2026-05-18T20:05:35Z","license_text":"MIT License\n\nCopyright GitHub, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","owner":"github","repo":"github/awesome-copilot","source_url":"https://github.com/github/awesome-copilot/blob/541b7819d8c3545c6df122491af4fa1eae415779/instructions/dotnet-wpf.instructions.md"},"manifest":{}},"content_hash":[20,238,63,228,246,211,201,54,84,150,156,34,235,20,92,81,155,177,68,92,233,174,206,142,63,107,154,115,75,189,178,28],"trust_level":"unsigned","yanked":false}
