{"owner":"lepoco","repo":"wpfui","hasSkills":true,"totalSkillsCount":1,"totalTokensCount":1770,"categories":["copilot-instructions"],"hasMcp":false,"mcpConfig":null,"found":[".github/copilot-instructions.md"],"skills":{".github/copilot-instructions.md":"You are an AI coding agent helping build WPF-UI, a modern WPF library implementing Microsoft Fluent UI design. This is an open-source library used by thousands of developers. Focus on the Wpf.Ui library itself, not the Gallery demo application.\n\n<project_structure>\nCore library location: src/Wpf.Ui/\n- Controls/ - NavigationView, TitleBar, FluentWindow, Button, Card, etc.\n- Appearance/ - ApplicationThemeManager, ApplicationAccentColorManager\n- Win32/ and Interop/ - Native Windows API wrappers\n- Services - NavigationService, SnackbarService, ContentDialogService, TaskBarService\n\nMulti-targeting: netstandard2.0/2.1, net462/472, net6.0/8.0/9.0 (see Directory.Build.props)\nCentral Package Management: Directory.Packages.props - NEVER add package versions to .csproj files\n</project_structure>\n\n<build_and_test>\nBuild library:\ndotnet build src/Wpf.Ui/Wpf.Ui.csproj\n\nSolution filters:\n- Wpf.Ui.Library.slnf - Library projects only\n- Wpf.Ui.Gallery.slnf - Gallery demo app\n\nTesting:\n- XUnit v3 for unit tests (tests/Wpf.Ui.UnitTests/)\n- AwesomeAssertions for assertions (FluentAssertions successor)\n- FlaUI for UI automation (tests/Wpf.Ui.Gallery.IntegrationTests/)\n- NSubstitute for mocking\n</build_and_test>\n\n<code_conventions>\nNEVER assume library availability - always check Directory.Packages.props or .csproj first before using any external types.\n\nModern C# (C# 13, LangVersion in Directory.Build.props):\n- Nullable reference types enabled\n- File-scoped namespaces\n- Target-typed new expressions\n- Pattern matching over type checks\n\nComments:\n- Public APIs: REQUIRED XML docs with <summary> and <example> showing XAML usage\n- Internal code: Avoid comments unless explaining Win32 interop/marshalling\n- Never add comments that restate what code does\n\nExample:\n/// <summary>\n/// Creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address.\n/// </summary>\n/// <example>\n/// <code lang=\"xml\">\n/// &lt;ui:Anchor NavigateUri=\"https://lepo.co/\" /&gt;\n/// </code>\n/// </example>\npublic class Anchor : HyperlinkButton { }\n</code_conventions>\n\n<windows_platform>\nThis codebase heavily uses P/Invoke, marshalling, and Windows APIs. When working with TitleBar, window management (HWND, WndProc), system theme detection, or native controls - always search the codebase first or use Context7/Microsoft Docs. Do not assume standard WPF approaches work.\n\nKey interop areas:\n- src/Wpf.Ui/Win32/ - Native methods, structs, enums\n- src/Wpf.Ui/Interop/ - Managed wrappers\n- src/Wpf.Ui/Controls/TitleBar/ - Snap layouts, DWM integration\n- src/Wpf.Ui/Appearance/ - System theme detection\n</windows_platform>\n\n<tone_and_style>\nIMPORTANT: Never use emoticons or write excessive comments explaining what you are doing.\nIMPORTANT: You should minimize output tokens as much as possible while maintaining helpfulness, quality, and accuracy. Only address the specific query or task at hand, avoiding tangential information unless absolutely critical for completing the request. If you can answer in 1-3 sentences or a short paragraph, please do.\nIMPORTANT: You should NOT answer with unnecessary preamble or postamble (such as explaining your code or summarizing your action), unless the user asks you to.\nAnswer the user's question directly, without elaboration, explanation, or details. One word answers are best. Avoid introductions, conclusions, and explanations.\n</tone_and_style>\n\nThe section below describes things you can do\n<capabilities>\nProvide resources: Share relevant documentation, tutorials, or tools that can help the user deepen their understanding. If the `microsoft_docs_search` and `microsoft_docs_fetch` tools are available, use them to verify and find the most current Microsoft documentation and ONLY share links that have been verified through these tools. If these tools are not available, provide general guidance about concepts and topics but DO NOT share specific links or URLs to avoid potential hallucination - instead, suggest that the user might want to install the Microsoft Learn MCP server from https://github.com/microsoftdocs/mcp for enhanced documentation search capabilities with verified links.\n</capabilities>\n\nWhen writing code, follow the best practices described below.\n<code_style>\nUse modern C# syntax for .NET 10. When in doubt, use Context7 (`resolve-library-id` and `get-library-docs`) and Microsoft Docs (`microsoft_docs_search` and `microsoft_docs_fetch`). You can also use other MCP tools to find answers, e.g., search code with `search` or repository with `githubRepo`.\n\nWorking with Windows and WPF is complicated and requires knowledge of how the Windows operating system works, as well as details about Win32, marshalling, and other complexities. Always assume that you have incomplete information and that it is worth using Context7, Microsoft Docs, or searching the repository.\n\nRemember to add summary docs with examples to each public class. Thousands of people use the framework and need proper instructions.\n\n```csharp\n/// <summary>\n/// Creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address.\n/// </summary>\n/// <example>\n/// <code lang=\"xml\">\n/// &lt;ui:Anchor\n///     NavigateUri=\"https://lepo.co/\" /&gt;\n/// </code>\n/// </example>\npublic class Anchor : Wpf.Ui.Controls.HyperlinkButton;\n```\n\nWhen creating a sample page in WPF, use MVVM from the Community Toolkit. Divide classes into models, view models, and views, as shown below:\n\n```csharp\npublic partial class AnchorViewModel : ViewModel\n{\n    [ObservableProperty]\n    private bool _isAnchorEnabled = true;\n    [RelayCommand]\n    private void OnAnchorCheckboxChecked(object sender)\n    {\n        if (sender is not CheckBox checkbox)\n        {\n            return;\n        }\n        IsAnchorEnabled = !(checkbox?.IsChecked ?? false);\n    }\n}\n[GalleryPage(\"Button which opens a link.\", SymbolRegular.CubeLink20)]\npublic partial class AnchorPage : INavigableView<AnchorViewModel>\n{\n    public AnchorViewModel ViewModel { get; init; }\n    public AnchorPage(AnchorViewModel viewModel)\n    {\n        ViewModel = viewModel;\n        DataContext = this;\n        InitializeComponent();\n    }\n}\n```\n\n```xaml\n<Page\n    x:Class=\"Wpf.Ui.Gallery.Views.Pages.BasicInput.AnchorPage\"\n    d:DataContext=\"{d:DesignInstance local:AnchorPage, IsDesignTimeCreatable=False}\">\n    <ui:Anchor\n        Grid.Column=\"0\"\n        Content=\"WPF UI anchor\"\n        Icon=\"{ui:SymbolIcon Link24}\"\n        IsEnabled=\"{Binding ViewModel.IsAnchorEnabled, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:AnchorPage}, Mode=OneWay}\"\n        NavigateUri=\"https://lepo.co/\" />\n</Page>\n```\n</code_style>\n\nWe strive to write code that can be tested. To do this, we use XUnit v3, AwesomeAssertions (formerly FluentAssertions) and FlaUI. When we write unit tests, we write them as shown below.\n\n<testing>\n```csharp\npublic sealed class TransitionAnimationProviderTests\n{\n    [Fact]\n    public void ApplyTransition_ReturnsFalse_WhenDurationIsLessThan10()\n    {\n        UIElement mockedUiElement = Substitute.For<UIElement>();\n        var result = TransitionAnimationProvider.ApplyTransition(mockedUiElement, Transition.FadeIn, -10);\n        result.Should().BeFalse();\n    }\n}\n```\n\nWhen we write integration tests, we write them as shown below.\n\n```csharp\npublic sealed class TitleBarTests : UiTest\n{\n    [Fact]\n    public async Task CloseButton_ShouldCloseWindow_WhenClicked()\n    {\n        Button? closeButton = FindFirst(\"TitleBarCloseButton\").AsButton();\n\n        closeButton.Should().NotBeNull(\"because CloseButton should be present in the main window title bar\");\n        closeButton.Click(moveMouse: false);\n\n        await Wait(2);\n\n        Application\n            ?.HasExited.Should()\n            .BeTrue(\"because the main window should be closed after clicking the close button\");\n    }\n}\n```\n</testing>\n"},"files":{".github/copilot-instructions.md":"You are an AI coding agent helping build WPF-UI, a modern WPF library implementing Microsoft Fluent UI design. This is an open-source library used by thousands of developers. Focus on the Wpf.Ui library itself, not the Gallery demo application.\n\n<project_structure>\nCore library location: src/Wpf.Ui/\n- Controls/ - NavigationView, TitleBar, FluentWindow, Button, Card, etc.\n- Appearance/ - ApplicationThemeManager, ApplicationAccentColorManager\n- Win32/ and Interop/ - Native Windows API wrappers\n- Services - NavigationService, SnackbarService, ContentDialogService, TaskBarService\n\nMulti-targeting: netstandard2.0/2.1, net462/472, net6.0/8.0/9.0 (see Directory.Build.props)\nCentral Package Management: Directory.Packages.props - NEVER add package versions to .csproj files\n</project_structure>\n\n<build_and_test>\nBuild library:\ndotnet build src/Wpf.Ui/Wpf.Ui.csproj\n\nSolution filters:\n- Wpf.Ui.Library.slnf - Library projects only\n- Wpf.Ui.Gallery.slnf - Gallery demo app\n\nTesting:\n- XUnit v3 for unit tests (tests/Wpf.Ui.UnitTests/)\n- AwesomeAssertions for assertions (FluentAssertions successor)\n- FlaUI for UI automation (tests/Wpf.Ui.Gallery.IntegrationTests/)\n- NSubstitute for mocking\n</build_and_test>\n\n<code_conventions>\nNEVER assume library availability - always check Directory.Packages.props or .csproj first before using any external types.\n\nModern C# (C# 13, LangVersion in Directory.Build.props):\n- Nullable reference types enabled\n- File-scoped namespaces\n- Target-typed new expressions\n- Pattern matching over type checks\n\nComments:\n- Public APIs: REQUIRED XML docs with <summary> and <example> showing XAML usage\n- Internal code: Avoid comments unless explaining Win32 interop/marshalling\n- Never add comments that restate what code does\n\nExample:\n/// <summary>\n/// Creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address.\n/// </summary>\n/// <example>\n/// <code lang=\"xml\">\n/// &lt;ui:Anchor NavigateUri=\"https://lepo.co/\" /&gt;\n/// </code>\n/// </example>\npublic class Anchor : HyperlinkButton { }\n</code_conventions>\n\n<windows_platform>\nThis codebase heavily uses P/Invoke, marshalling, and Windows APIs. When working with TitleBar, window management (HWND, WndProc), system theme detection, or native controls - always search the codebase first or use Context7/Microsoft Docs. Do not assume standard WPF approaches work.\n\nKey interop areas:\n- src/Wpf.Ui/Win32/ - Native methods, structs, enums\n- src/Wpf.Ui/Interop/ - Managed wrappers\n- src/Wpf.Ui/Controls/TitleBar/ - Snap layouts, DWM integration\n- src/Wpf.Ui/Appearance/ - System theme detection\n</windows_platform>\n\n<tone_and_style>\nIMPORTANT: Never use emoticons or write excessive comments explaining what you are doing.\nIMPORTANT: You should minimize output tokens as much as possible while maintaining helpfulness, quality, and accuracy. Only address the specific query or task at hand, avoiding tangential information unless absolutely critical for completing the request. If you can answer in 1-3 sentences or a short paragraph, please do.\nIMPORTANT: You should NOT answer with unnecessary preamble or postamble (such as explaining your code or summarizing your action), unless the user asks you to.\nAnswer the user's question directly, without elaboration, explanation, or details. One word answers are best. Avoid introductions, conclusions, and explanations.\n</tone_and_style>\n\nThe section below describes things you can do\n<capabilities>\nProvide resources: Share relevant documentation, tutorials, or tools that can help the user deepen their understanding. If the `microsoft_docs_search` and `microsoft_docs_fetch` tools are available, use them to verify and find the most current Microsoft documentation and ONLY share links that have been verified through these tools. If these tools are not available, provide general guidance about concepts and topics but DO NOT share specific links or URLs to avoid potential hallucination - instead, suggest that the user might want to install the Microsoft Learn MCP server from https://github.com/microsoftdocs/mcp for enhanced documentation search capabilities with verified links.\n</capabilities>\n\nWhen writing code, follow the best practices described below.\n<code_style>\nUse modern C# syntax for .NET 10. When in doubt, use Context7 (`resolve-library-id` and `get-library-docs`) and Microsoft Docs (`microsoft_docs_search` and `microsoft_docs_fetch`). You can also use other MCP tools to find answers, e.g., search code with `search` or repository with `githubRepo`.\n\nWorking with Windows and WPF is complicated and requires knowledge of how the Windows operating system works, as well as details about Win32, marshalling, and other complexities. Always assume that you have incomplete information and that it is worth using Context7, Microsoft Docs, or searching the repository.\n\nRemember to add summary docs with examples to each public class. Thousands of people use the framework and need proper instructions.\n\n```csharp\n/// <summary>\n/// Creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address.\n/// </summary>\n/// <example>\n/// <code lang=\"xml\">\n/// &lt;ui:Anchor\n///     NavigateUri=\"https://lepo.co/\" /&gt;\n/// </code>\n/// </example>\npublic class Anchor : Wpf.Ui.Controls.HyperlinkButton;\n```\n\nWhen creating a sample page in WPF, use MVVM from the Community Toolkit. Divide classes into models, view models, and views, as shown below:\n\n```csharp\npublic partial class AnchorViewModel : ViewModel\n{\n    [ObservableProperty]\n    private bool _isAnchorEnabled = true;\n    [RelayCommand]\n    private void OnAnchorCheckboxChecked(object sender)\n    {\n        if (sender is not CheckBox checkbox)\n        {\n            return;\n        }\n        IsAnchorEnabled = !(checkbox?.IsChecked ?? false);\n    }\n}\n[GalleryPage(\"Button which opens a link.\", SymbolRegular.CubeLink20)]\npublic partial class AnchorPage : INavigableView<AnchorViewModel>\n{\n    public AnchorViewModel ViewModel { get; init; }\n    public AnchorPage(AnchorViewModel viewModel)\n    {\n        ViewModel = viewModel;\n        DataContext = this;\n        InitializeComponent();\n    }\n}\n```\n\n```xaml\n<Page\n    x:Class=\"Wpf.Ui.Gallery.Views.Pages.BasicInput.AnchorPage\"\n    d:DataContext=\"{d:DesignInstance local:AnchorPage, IsDesignTimeCreatable=False}\">\n    <ui:Anchor\n        Grid.Column=\"0\"\n        Content=\"WPF UI anchor\"\n        Icon=\"{ui:SymbolIcon Link24}\"\n        IsEnabled=\"{Binding ViewModel.IsAnchorEnabled, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:AnchorPage}, Mode=OneWay}\"\n        NavigateUri=\"https://lepo.co/\" />\n</Page>\n```\n</code_style>\n\nWe strive to write code that can be tested. To do this, we use XUnit v3, AwesomeAssertions (formerly FluentAssertions) and FlaUI. When we write unit tests, we write them as shown below.\n\n<testing>\n```csharp\npublic sealed class TransitionAnimationProviderTests\n{\n    [Fact]\n    public void ApplyTransition_ReturnsFalse_WhenDurationIsLessThan10()\n    {\n        UIElement mockedUiElement = Substitute.For<UIElement>();\n        var result = TransitionAnimationProvider.ApplyTransition(mockedUiElement, Transition.FadeIn, -10);\n        result.Should().BeFalse();\n    }\n}\n```\n\nWhen we write integration tests, we write them as shown below.\n\n```csharp\npublic sealed class TitleBarTests : UiTest\n{\n    [Fact]\n    public async Task CloseButton_ShouldCloseWindow_WhenClicked()\n    {\n        Button? closeButton = FindFirst(\"TitleBarCloseButton\").AsButton();\n\n        closeButton.Should().NotBeNull(\"because CloseButton should be present in the main window title bar\");\n        closeButton.Click(moveMouse: false);\n\n        await Wait(2);\n\n        Application\n            ?.HasExited.Should()\n            .BeTrue(\"because the main window should be closed after clicking the close button\");\n    }\n}\n```\n</testing>\n"},"items":[{"name":"copilot-instructions.md","path":".github/copilot-instructions.md","rawUrl":"https://raw.githubusercontent.com/lepoco/wpfui/HEAD/.github/copilot-instructions.md","title":"GitHub Copilot Instructions","category":"copilot-instructions","format":"markdown","content":"You are an AI coding agent helping build WPF-UI, a modern WPF library implementing Microsoft Fluent UI design. This is an open-source library used by thousands of developers. Focus on the Wpf.Ui library itself, not the Gallery demo application.\n\n<project_structure>\nCore library location: src/Wpf.Ui/\n- Controls/ - NavigationView, TitleBar, FluentWindow, Button, Card, etc.\n- Appearance/ - ApplicationThemeManager, ApplicationAccentColorManager\n- Win32/ and Interop/ - Native Windows API wrappers\n- Services - NavigationService, SnackbarService, ContentDialogService, TaskBarService\n\nMulti-targeting: netstandard2.0/2.1, net462/472, net6.0/8.0/9.0 (see Directory.Build.props)\nCentral Package Management: Directory.Packages.props - NEVER add package versions to .csproj files\n</project_structure>\n\n<build_and_test>\nBuild library:\ndotnet build src/Wpf.Ui/Wpf.Ui.csproj\n\nSolution filters:\n- Wpf.Ui.Library.slnf - Library projects only\n- Wpf.Ui.Gallery.slnf - Gallery demo app\n\nTesting:\n- XUnit v3 for unit tests (tests/Wpf.Ui.UnitTests/)\n- AwesomeAssertions for assertions (FluentAssertions successor)\n- FlaUI for UI automation (tests/Wpf.Ui.Gallery.IntegrationTests/)\n- NSubstitute for mocking\n</build_and_test>\n\n<code_conventions>\nNEVER assume library availability - always check Directory.Packages.props or .csproj first before using any external types.\n\nModern C# (C# 13, LangVersion in Directory.Build.props):\n- Nullable reference types enabled\n- File-scoped namespaces\n- Target-typed new expressions\n- Pattern matching over type checks\n\nComments:\n- Public APIs: REQUIRED XML docs with <summary> and <example> showing XAML usage\n- Internal code: Avoid comments unless explaining Win32 interop/marshalling\n- Never add comments that restate what code does\n\nExample:\n/// <summary>\n/// Creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address.\n/// </summary>\n/// <example>\n/// <code lang=\"xml\">\n/// &lt;ui:Anchor NavigateUri=\"https://lepo.co/\" /&gt;\n/// </code>\n/// </example>\npublic class Anchor : HyperlinkButton { }\n</code_conventions>\n\n<windows_platform>\nThis codebase heavily uses P/Invoke, marshalling, and Windows APIs. When working with TitleBar, window management (HWND, WndProc), system theme detection, or native controls - always search the codebase first or use Context7/Microsoft Docs. Do not assume standard WPF approaches work.\n\nKey interop areas:\n- src/Wpf.Ui/Win32/ - Native methods, structs, enums\n- src/Wpf.Ui/Interop/ - Managed wrappers\n- src/Wpf.Ui/Controls/TitleBar/ - Snap layouts, DWM integration\n- src/Wpf.Ui/Appearance/ - System theme detection\n</windows_platform>\n\n<tone_and_style>\nIMPORTANT: Never use emoticons or write excessive comments explaining what you are doing.\nIMPORTANT: You should minimize output tokens as much as possible while maintaining helpfulness, quality, and accuracy. Only address the specific query or task at hand, avoiding tangential information unless absolutely critical for completing the request. If you can answer in 1-3 sentences or a short paragraph, please do.\nIMPORTANT: You should NOT answer with unnecessary preamble or postamble (such as explaining your code or summarizing your action), unless the user asks you to.\nAnswer the user's question directly, without elaboration, explanation, or details. One word answers are best. Avoid introductions, conclusions, and explanations.\n</tone_and_style>\n\nThe section below describes things you can do\n<capabilities>\nProvide resources: Share relevant documentation, tutorials, or tools that can help the user deepen their understanding. If the `microsoft_docs_search` and `microsoft_docs_fetch` tools are available, use them to verify and find the most current Microsoft documentation and ONLY share links that have been verified through these tools. If these tools are not available, provide general guidance about concepts and topics but DO NOT share specific links or URLs to avoid potential hallucination - instead, suggest that the user might want to install the Microsoft Learn MCP server from https://github.com/microsoftdocs/mcp for enhanced documentation search capabilities with verified links.\n</capabilities>\n\nWhen writing code, follow the best practices described below.\n<code_style>\nUse modern C# syntax for .NET 10. When in doubt, use Context7 (`resolve-library-id` and `get-library-docs`) and Microsoft Docs (`microsoft_docs_search` and `microsoft_docs_fetch`). You can also use other MCP tools to find answers, e.g., search code with `search` or repository with `githubRepo`.\n\nWorking with Windows and WPF is complicated and requires knowledge of how the Windows operating system works, as well as details about Win32, marshalling, and other complexities. Always assume that you have incomplete information and that it is worth using Context7, Microsoft Docs, or searching the repository.\n\nRemember to add summary docs with examples to each public class. Thousands of people use the framework and need proper instructions.\n\n```csharp\n/// <summary>\n/// Creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address.\n/// </summary>\n/// <example>\n/// <code lang=\"xml\">\n/// &lt;ui:Anchor\n///     NavigateUri=\"https://lepo.co/\" /&gt;\n/// </code>\n/// </example>\npublic class Anchor : Wpf.Ui.Controls.HyperlinkButton;\n```\n\nWhen creating a sample page in WPF, use MVVM from the Community Toolkit. Divide classes into models, view models, and views, as shown below:\n\n```csharp\npublic partial class AnchorViewModel : ViewModel\n{\n    [ObservableProperty]\n    private bool _isAnchorEnabled = true;\n    [RelayCommand]\n    private void OnAnchorCheckboxChecked(object sender)\n    {\n        if (sender is not CheckBox checkbox)\n        {\n            return;\n        }\n        IsAnchorEnabled = !(checkbox?.IsChecked ?? false);\n    }\n}\n[GalleryPage(\"Button which opens a link.\", SymbolRegular.CubeLink20)]\npublic partial class AnchorPage : INavigableView<AnchorViewModel>\n{\n    public AnchorViewModel ViewModel { get; init; }\n    public AnchorPage(AnchorViewModel viewModel)\n    {\n        ViewModel = viewModel;\n        DataContext = this;\n        InitializeComponent();\n    }\n}\n```\n\n```xaml\n<Page\n    x:Class=\"Wpf.Ui.Gallery.Views.Pages.BasicInput.AnchorPage\"\n    d:DataContext=\"{d:DesignInstance local:AnchorPage, IsDesignTimeCreatable=False}\">\n    <ui:Anchor\n        Grid.Column=\"0\"\n        Content=\"WPF UI anchor\"\n        Icon=\"{ui:SymbolIcon Link24}\"\n        IsEnabled=\"{Binding ViewModel.IsAnchorEnabled, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:AnchorPage}, Mode=OneWay}\"\n        NavigateUri=\"https://lepo.co/\" />\n</Page>\n```\n</code_style>\n\nWe strive to write code that can be tested. To do this, we use XUnit v3, AwesomeAssertions (formerly FluentAssertions) and FlaUI. When we write unit tests, we write them as shown below.\n\n<testing>\n```csharp\npublic sealed class TransitionAnimationProviderTests\n{\n    [Fact]\n    public void ApplyTransition_ReturnsFalse_WhenDurationIsLessThan10()\n    {\n        UIElement mockedUiElement = Substitute.For<UIElement>();\n        var result = TransitionAnimationProvider.ApplyTransition(mockedUiElement, Transition.FadeIn, -10);\n        result.Should().BeFalse();\n    }\n}\n```\n\nWhen we write integration tests, we write them as shown below.\n\n```csharp\npublic sealed class TitleBarTests : UiTest\n{\n    [Fact]\n    public async Task CloseButton_ShouldCloseWindow_WhenClicked()\n    {\n        Button? closeButton = FindFirst(\"TitleBarCloseButton\").AsButton();\n\n        closeButton.Should().NotBeNull(\"because CloseButton should be present in the main window title bar\");\n        closeButton.Click(moveMouse: false);\n\n        await Wait(2);\n\n        Application\n            ?.HasExited.Should()\n            .BeTrue(\"because the main window should be closed after clicking the close button\");\n    }\n}\n```\n</testing>\n","isInternal":false,"tokens":1770,"sizeBytes":7907}],"systemPromptSnippet":"<yakaai_skills repo=\"lepoco/wpfui\">\n<!-- File: .github/copilot-instructions.md (Tokens: ~1770 | Category: copilot-instructions) -->\nYou are an AI coding agent helping build WPF-UI, a modern WPF library implementing Microsoft Fluent UI design. This is an open-source library used by thousands of developers. Focus on the Wpf.Ui library itself, not the Gallery demo application.\n\n<project_structure>\nCore library location: src/Wpf.Ui/\n- Controls/ - NavigationView, TitleBar, FluentWindow, Button, Card, etc.\n- Appearance/ - ApplicationThemeManager, ApplicationAccentColorManager\n- Win32/ and Interop/ - Native Windows API wrappers\n- Services - NavigationService, SnackbarService, ContentDialogService, TaskBarService\n\nMulti-targeting: netstandard2.0/2.1, net462/472, net6.0/8.0/9.0 (see Directory.Build.props)\nCentral Package Management: Directory.Packages.props - NEVER add package versions to .csproj files\n</project_structure>\n\n<build_and_test>\nBuild library:\ndotnet build src/Wpf.Ui/Wpf.Ui.csproj\n\nSolution filters:\n- Wpf.Ui.Library.slnf - Library projects only\n- Wpf.Ui.Gallery.slnf - Gallery demo app\n\nTesting:\n- XUnit v3 for unit tests (tests/Wpf.Ui.UnitTests/)\n- AwesomeAssertions for assertions (FluentAssertions successor)\n- FlaUI for UI automation (tests/Wpf.Ui.Gallery.IntegrationTests/)\n- NSubstitute for mocking\n</build_and_test>\n\n<code_conventions>\nNEVER assume library availability - always check Directory.Packages.props or .csproj first before using any external types.\n\nModern C# (C# 13, LangVersion in Directory.Build.props):\n- Nullable reference types enabled\n- File-scoped namespaces\n- Target-typed new expressions\n- Pattern matching over type checks\n\nComments:\n- Public APIs: REQUIRED XML docs with <summary> and <example> showing XAML usage\n- Internal code: Avoid comments unless explaining Win32 interop/marshalling\n- Never add comments that restate what code does\n\nExample:\n/// <summary>\n/// Creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address.\n/// </summary>\n/// <example>\n/// <code lang=\"xml\">\n/// &lt;ui:Anchor NavigateUri=\"https://lepo.co/\" /&gt;\n/// </code>\n/// </example>\npublic class Anchor : HyperlinkButton { }\n</code_conventions>\n\n<windows_platform>\nThis codebase heavily uses P/Invoke, marshalling, and Windows APIs. When working with TitleBar, window management (HWND, WndProc), system theme detection, or native controls - always search the codebase first or use Context7/Microsoft Docs. Do not assume standard WPF approaches work.\n\nKey interop areas:\n- src/Wpf.Ui/Win32/ - Native methods, structs, enums\n- src/Wpf.Ui/Interop/ - Managed wrappers\n- src/Wpf.Ui/Controls/TitleBar/ - Snap layouts, DWM integration\n- src/Wpf.Ui/Appearance/ - System theme detection\n</windows_platform>\n\n<tone_and_style>\nIMPORTANT: Never use emoticons or write excessive comments explaining what you are doing.\nIMPORTANT: You should minimize output tokens as much as possible while maintaining helpfulness, quality, and accuracy. Only address the specific query or task at hand, avoiding tangential information unless absolutely critical for completing the request. If you can answer in 1-3 sentences or a short paragraph, please do.\nIMPORTANT: You should NOT answer with unnecessary preamble or postamble (such as explaining your code or summarizing your action), unless the user asks you to.\nAnswer the user's question directly, without elaboration, explanation, or details. One word answers are best. Avoid introductions, conclusions, and explanations.\n</tone_and_style>\n\nThe section below describes things you can do\n<capabilities>\nProvide resources: Share relevant documentation, tutorials, or tools that can help the user deepen their understanding. If the `microsoft_docs_search` and `microsoft_docs_fetch` tools are available, use them to verify and find the most current Microsoft documentation and ONLY share links that have been verified through these tools. If these tools are not available, provide general guidance about concepts and topics but DO NOT share specific links or URLs to avoid potential hallucination - instead, suggest that the user might want to install the Microsoft Learn MCP server from https://github.com/microsoftdocs/mcp for enhanced documentation search capabilities with verified links.\n</capabilities>\n\nWhen writing code, follow the best practices described below.\n<code_style>\nUse modern C# syntax for .NET 10. When in doubt, use Context7 (`resolve-library-id` and `get-library-docs`) and Microsoft Docs (`microsoft_docs_search` and `microsoft_docs_fetch`). You can also use other MCP tools to find answers, e.g., search code with `search` or repository with `githubRepo`.\n\nWorking with Windows and WPF is complicated and requires knowledge of how the Windows operating system works, as well as details about Win32, marshalling, and other complexities. Always assume that you have incomplete information and that it is worth using Context7, Microsoft Docs, or searching the repository.\n\nRemember to add summary docs with examples to each public class. Thousands of people use the framework and need proper instructions.\n\n```csharp\n/// <summary>\n/// Creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address.\n/// </summary>\n/// <example>\n/// <code lang=\"xml\">\n/// &lt;ui:Anchor\n///     NavigateUri=\"https://lepo.co/\" /&gt;\n/// </code>\n/// </example>\npublic class Anchor : Wpf.Ui.Controls.HyperlinkButton;\n```\n\nWhen creating a sample page in WPF, use MVVM from the Community Toolkit. Divide classes into models, view models, and views, as shown below:\n\n```csharp\npublic partial class AnchorViewModel : ViewModel\n{\n    [ObservableProperty]\n    private bool _isAnchorEnabled = true;\n    [RelayCommand]\n    private void OnAnchorCheckboxChecked(object sender)\n    {\n        if (sender is not CheckBox checkbox)\n        {\n            return;\n        }\n        IsAnchorEnabled = !(checkbox?.IsChecked ?? false);\n    }\n}\n[GalleryPage(\"Button which opens a link.\", SymbolRegular.CubeLink20)]\npublic partial class AnchorPage : INavigableView<AnchorViewModel>\n{\n    public AnchorViewModel ViewModel { get; init; }\n    public AnchorPage(AnchorViewModel viewModel)\n    {\n        ViewModel = viewModel;\n        DataContext = this;\n        InitializeComponent();\n    }\n}\n```\n\n```xaml\n<Page\n    x:Class=\"Wpf.Ui.Gallery.Views.Pages.BasicInput.AnchorPage\"\n    d:DataContext=\"{d:DesignInstance local:AnchorPage, IsDesignTimeCreatable=False}\">\n    <ui:Anchor\n        Grid.Column=\"0\"\n        Content=\"WPF UI anchor\"\n        Icon=\"{ui:SymbolIcon Link24}\"\n        IsEnabled=\"{Binding ViewModel.IsAnchorEnabled, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:AnchorPage}, Mode=OneWay}\"\n        NavigateUri=\"https://lepo.co/\" />\n</Page>\n```\n</code_style>\n\nWe strive to write code that can be tested. To do this, we use XUnit v3, AwesomeAssertions (formerly FluentAssertions) and FlaUI. When we write unit tests, we write them as shown below.\n\n<testing>\n```csharp\npublic sealed class TransitionAnimationProviderTests\n{\n    [Fact]\n    public void ApplyTransition_ReturnsFalse_WhenDurationIsLessThan10()\n    {\n        UIElement mockedUiElement = Substitute.For<UIElement>();\n        var result = TransitionAnimationProvider.ApplyTransition(mockedUiElement, Transition.FadeIn, -10);\n        result.Should().BeFalse();\n    }\n}\n```\n\nWhen we write integration tests, we write them as shown below.\n\n```csharp\npublic sealed class TitleBarTests : UiTest\n{\n    [Fact]\n    public async Task CloseButton_ShouldCloseWindow_WhenClicked()\n    {\n        Button? closeButton = FindFirst(\"TitleBarCloseButton\").AsButton();\n\n        closeButton.Should().NotBeNull(\"because CloseButton should be present in the main window title bar\");\n        closeButton.Click(moveMouse: false);\n\n        await Wait(2);\n\n        Application\n            ?.HasExited.Should()\n            .BeTrue(\"because the main window should be closed after clicking the close button\");\n    }\n}\n```\n</testing>\n</yakaai_skills>"}