wpfui
Copilot instructions9.7k starsChanged 4 years agoMITView on GitHub
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. Multi-targeting: netstandard2.0/2.1, net462/472, net6.0/8.0/9.0 (see Directory.Build.props) Central Package Management: Directory.Packages.props - NEVER add package versions to .csproj files </project_structure> Solution filters: - Wpf.Ui.Library.slnf - Library projects only - Wpf.Ui.Gallery.slnf - Gallery demo app Testing: - XUnit v3 for unit tests (tests/Wpf.Ui.UnitTests/)…
We split this copilot-instructions.md into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 30
NEVER assume library availability - always check Directory.Packages.props or .csproj first before using any external types.
- Distinctive: line 41
Never add comments that restate what code does
- Very specific: line 77
When writing code, follow the best practices described below.
- Very specific: line 79
Use modern C# syntax for .NET 10.
- Distinctive: line 98
When creating a sample page in WPF, use MVVM from the Community Toolkit.
- Distinctive: line 158
When we write integration tests, we write them as shown below.
≈ “Common” is an estimate: at least 1 in 5 of the 3,669 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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.
<project_structure> Core library location: src/Wpf.Ui/
- Controls/ - NavigationView, TitleBar, FluentWindow, Button, Card, etc.
- Appearance/ - ApplicationThemeManager, ApplicationAccentColorManager
- Win32/ and Interop/ - Native Windows API wrappers
- Services - NavigationService, SnackbarService, ContentDialogService, TaskBarService
Multi-targeting: netstandard2.0/2.1, net462/472, net6.0/8.0/9.0 (see Directory.Build.props) Central Package Management: Directory.Packages.props - NEVER add package versions to .csproj files </project_structure>
<build_and_test> Build library: dotnet build src/Wpf.Ui/Wpf.Ui.csproj
Solution filters:
- Wpf.Ui.Library.slnf - Library projects only
- Wpf.Ui.Gallery.slnf - Gallery demo app
Testing:
- XUnit v3 for unit tests (tests/Wpf.Ui.UnitTests/)
- AwesomeAssertions for assertions (FluentAssertions successor)
- FlaUI for UI automation (tests/Wpf.Ui.Gallery.IntegrationTests/)
- NSubstitute for mocking </build_and_test>
<code_conventions> NEVER assume library availability - always check Directory.Packages.props or .csproj first before using any external types.
Modern C# (C# 13, LangVersion in Directory.Build.props):
- Nullable reference types enabled
- File-scoped namespaces
- Target-typed new expressions
- Pattern matching over type checks
Comments:
- Public APIs: REQUIRED XML docs with
<summary>and<example>showing XAML usage - Internal code: Avoid comments unless explaining Win32 interop/marshalling
- Never add comments that restate what code does
Example:
/// <summary>
/// Creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address.
/// </summary>
/// <example>
/// <code lang="xml">
/// <ui:Anchor NavigateUri="https://lepo.co/" />
/// </code>
/// </example>
public class Anchor : HyperlinkButton { }
</code_conventions>
<windows_platform> This 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.
Key interop areas:
- src/Wpf.Ui/Win32/ - Native methods, structs, enums
- src/Wpf.Ui/Interop/ - Managed wrappers
- src/Wpf.Ui/Controls/TitleBar/ - Snap layouts, DWM integration
- src/Wpf.Ui/Appearance/ - System theme detection </windows_platform>
<tone_and_style> IMPORTANT: Never use emoticons or write excessive comments explaining what you are doing. IMPORTANT: 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. IMPORTANT: You should NOT answer with unnecessary preamble or postamble (such as explaining your code or summarizing your action), unless the user asks you to. Answer the user's question directly, without elaboration, explanation, or details. One word answers are best. Avoid introductions, conclusions, and explanations. </tone_and_style>
The section below describes things you can do
<capabilities>
Provide 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.
</capabilities>
When writing code, follow the best practices described below.
<code_style>
Use 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.
Working 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.
Remember to add summary docs with examples to each public class. Thousands of people use the framework and need proper instructions.
/// <summary>
/// Creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address.
/// </summary>
/// <example>
/// <code lang="xml">
/// <ui:Anchor
/// NavigateUri="https://lepo.co/" />
/// </code>
/// </example>
public class Anchor : Wpf.Ui.Controls.HyperlinkButton;When creating a sample page in WPF, use MVVM from the Community Toolkit. Divide classes into models, view models, and views, as shown below:
public partial class AnchorViewModel : ViewModel
{
[ObservableProperty]
private bool _isAnchorEnabled = true;
[RelayCommand]
private void OnAnchorCheckboxChecked(object sender)
{
if (sender is not CheckBox checkbox)
{
return;
}
IsAnchorEnabled = !(checkbox?.IsChecked ?? false);
}
}
[GalleryPage("Button which opens a link.", SymbolRegular.CubeLink20)]
public partial class AnchorPage : INavigableView<AnchorViewModel>
{
public AnchorViewModel ViewModel { get; init; }
public AnchorPage(AnchorViewModel viewModel)
{
ViewModel = viewModel;
DataContext = this;
InitializeComponent();
}
}<Page
x:Class="Wpf.Ui.Gallery.Views.Pages.BasicInput.AnchorPage"
d:DataContext="{d:DesignInstance local:AnchorPage, IsDesignTimeCreatable=False}">
<ui:Anchor
Grid.Column="0"
Content="WPF UI anchor"
Icon="{ui:SymbolIcon Link24}"
IsEnabled="{Binding ViewModel.IsAnchorEnabled, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:AnchorPage}, Mode=OneWay}"
NavigateUri="https://lepo.co/" />
</Page></code_style>
We 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.
<testing>
```csharp
public sealed class TransitionAnimationProviderTests
{
[Fact]
public void ApplyTransition_ReturnsFalse_WhenDurationIsLessThan10()
{
UIElement mockedUiElement = Substitute.For<UIElement>();
var result = TransitionAnimationProvider.ApplyTransition(mockedUiElement, Transition.FadeIn, -10);
result.Should().BeFalse();
}
}
```When we write integration tests, we write them as shown below.
public sealed class TitleBarTests : UiTest
{
[Fact]
public async Task CloseButton_ShouldCloseWindow_WhenClicked()
{
Button? closeButton = FindFirst("TitleBarCloseButton").AsButton();
closeButton.Should().NotBeNull("because CloseButton should be present in the main window title bar");
closeButton.Click(moveMouse: false);
await Wait(2);
Application
?.HasExited.Should()
.BeTrue("because the main window should be closed after clicking the close button");
}
}</testing>Trending
Less talk lately.about the whole repository
Who's talking about lepoco/wpfui
- A Hacker News story“I Rewrote WinUI to WPF”Hacker News · Dec 2, 2021 · 165 points
- Alex4SSB/ADB-Explorer“⚡Abandon ModernWpf in favor of WPF UI”GitHub · Jul 14, 2025 · 4 reactions
- JamesCJ60/Universal-x86-Tuning-Utility“[BUG] WPFUI bug preventing launch”GitHub · Jul 24, 2024 · 4 reactions
- dotnet/wpf“Fluent Themes contain invalid DataGridColumn styles”GitHub · Sep 10, 2024 · 2 reactions
- capy-ui/capy“Add a WinUI3 look”GitHub · Feb 5, 2023 · 2 reactions
The biggest 5 of 56 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 56
Talked about on GitHub, the web, Hacker News and Stack Overflow (56 times).
On GitHub · 50
- Jul 14, 2025⚡Abandon ModernWpf in favor of WPF UI — Alex4SSB/ADB-Explorer4 reactions
- Jul 24, 2024[BUG] WPFUI bug preventing launch — JamesCJ60/Universal-x86-Tuning-Utility4 reactions · 5 comments
- Sep 10, 2024Fluent Themes contain invalid DataGridColumn styles — dotnet/wpf2 reactions · 2 comments
- Feb 5, 2023Add a WinUI3 look — capy-ui/capy2 reactions · 1 comment
- Jun 24, 2025Make auth window follow the same style as MainWindow — ddani-commits/AsComputoPOS1 reaction
45 more on GitHub
- Jan 30, 2025Rewrite WPF pack-URIs found in CLR strings — gluck/il-repack1 reaction · 5 comments
- May 21, 2024New UI — U-C-S/Hurl1 reaction · 17 comments
- Nov 24, 2023Bump WPF-UI to preview.11 — microsoft/PowerToys1 reaction · 5 comments
- Oct 23, 2026Bump WPF-UI from 4.2.0 to 4.3.0 — brendonpereiradev/Hermes0 reactions
- Oct 16, 2026Bump the nuget-minor-and-patch group with 1 update — MohandL3G/CloudReEdit0 reactions
- Oct 8, 2026chore(依存関係): WPF-UI を 4.0.0 から 4.3.0 に更新 — Akatuki1121/Purge0 reactions · 3 comments
- Oct 4, 2026Product-family foundation — app boundaries, packaging, brand and design system — Hugowhitee/ThinkControl0 reactions
- Sep 27, 2026Bump WPF-UI from 4.0.3 to 4.3.0 — MrBisquit/Flashcardy0 reactions
- Sep 15, 2026Bump the nuget-all group with 6 updates — inakizamores/vantagedisplaymanager0 reactions · 1 comment
- Aug 27, 2026deps: Bump WPF-UI from 4.0.3 to 4.3.0 — Bordder/rl-account-switcher0 reactions · 1 comment
- Aug 20, 2026Bump WPF-UI.Tray from 4.0.3 to 4.3.0 — marcmy/CompactGUI0 reactions
- Aug 20, 2026Bump WPF-UI.DependencyInjection from 4.0.3 to 4.3.0 — marcmy/CompactGUI0 reactions
- Aug 20, 2026Bump WPF-UI from 4.0.3 to 4.3.0 — marcmy/CompactGUI0 reactions
- Aug 18, 2026Bump the nuget-all group with 6 updates — inakizamores/vantagedisplaymanager0 reactions · 2 comments
- Aug 15, 2026chore(deps): bump wpfui from `f869a7d` to `153baad` — LunarisStrap/LunarisStrap0 reactions
- Aug 6, 2026WPF UI Library — NodesAutomations/CSharp0 reactions
- Aug 4, 2026Bump CommunityToolkit.Mvvm and 5 others — inakizamores/vantagedisplaymanager0 reactions · 1 comment
- Aug 4, 2026Bump CommunityToolkit.Mvvm, H.NotifyIcon.Wpf and WPF-UI — inakizamores/vantagedisplaymanager0 reactions · 1 comment
- Jul 13, 2026chore[nuget]: Bump the updates group with 11 updates — WolfwithSword/SubathonManager0 reactions · 1 comment
- Jul 9, 2026chore(nuget): Bump System.Management, System.ValueTuple and WPF-UI — splrad/LayerScape0 reactions · 3 comments
- Jul 9, 2026chore(nuget): Bump the dotnet-dependencies group with 4 updates — splrad/LayerScape0 reactions · 3 comments
- Jul 8, 2026Bump WPF-UI from 4.0.2 to 4.3.0 — mitchellvette/zenvizor0 reactions
- Jul 6, 2026chore[nuget]: Bump the updates group with 10 updates — WolfwithSword/SubathonManager0 reactions · 1 comment
- Jun 29, 2026chore[nuget]: Bump Microsoft.NET.Test.Sdk and WPF-UI — WolfwithSword/SubathonManager0 reactions · 1 comment
- Jun 22, 2026chore[nuget]: Bump Agash.Webhook.Abstractions and 8 others — WolfwithSword/SubathonManager0 reactions · 1 comment
- Jun 17, 2026chore[nuget]: Bump WPF-UI from 4.2.0 to 4.3.0 — WolfwithSword/SubathonManager0 reactions · 1 comment
- Jun 15, 2026chore[nuget]: Bump WPF-UI from 4.2.0 to 4.3.0 — WolfwithSword/SubathonManager0 reactions · 1 comment
- Jun 13, 2026Update dependency WPF-UI.DependencyInjection to 4.3.0 — mvmcjr/Frituquim0 reactions
- Jun 13, 2026Update dependency WPF-UI to 4.3.0 — mvmcjr/Frituquim0 reactions
- Jun 12, 2026Update dependency WPF-UI to 4.3.0 — BeyondDimension/Common0 reactions
- Jun 12, 2026(chore) Renovate: Update WPF-UI.Tray to 4.3.0 — jibedoubleve/lanceur-bis0 reactions · 1 comment
- Jun 12, 2026(chore) Renovate: Update WPF-UI to 4.3.0 — jibedoubleve/lanceur-bis0 reactions · 1 comment
- Jun 10, 2026Change UI to WPF UI (Fluent design) ALL new version — tleaha/hayviewer0 reactions
- Jun 2, 2026Bump WPF-UI.Tray from 4.2.1 to 4.3.0 — c0nstexpr/Turnbind0 reactions
- May 12, 2026[Enhancement]: Architecture — Replace ModernWpfUI with WPF UI (wpfui) — laurentiu021/SystemManager0 reactions · 3 comments
- May 11, 2026chore(deps): Bump WPF-UI from 3.0.5 to 4.3.0 — SweetsNSavories/VerseOps0 reactions · 1 comment
- May 9, 2026Bump WPF-UI from 4.2.1 to 4.3.0 — cyclopsgd/Deskbridge0 reactions
- Apr 17, 2026Fluent Windows 11 styl — Firexik/QuickMicSwitcher0 reactions
- Feb 22, 2026Bump WPF-UI from 2.1.0 to 4.2.0 — DT-Deville/DTstrap0 reactions
- Feb 1, 2026Bump WPF-UI from 4.1.0 to 4.2.0 — JuniorDark/RustyHearts-Toolkit0 reactions
- Jan 21, 2026WPFUI anschauen und integrieren — ScheerleJo/ITS_MaxTemp0 reactions
- Dec 22, 2025Bump WPF-UI from 3.0.5 to 4.1.0 — Lunova-Studio/DarkMode20 reactions
- Nov 7, 2025Unknow element "syntax" makes the styler crash — Xavalon/XamlStyler0 reactions · 1 comment
- Oct 1, 2025Window のタイトルバー部分からリサイズできない — kuramochia/ToraCon-Helper0 reactions
- Mar 10, 2025Multiselect-Combobox width is pretty narrow in combination with WPF.UI Framework. — RWS/Multiselect-ComboBox0 reactions · 4 comments
On the web · 3
- Mar 21, 2025Outdated WPF UI Gallery · Issue #1384 · lepoco/wpfui — google.com
- May 4, 2023WPF UI Gallery Problem · Issue #624 · lepoco/wpfui — google.com
- Sep 25, 2022WPF-UI 2.0.3 — google.com
On Hacker News · 2
- Dec 2, 2021I Rewrote WinUI to WPF165 points · 86 comments
- Dec 1, 2021Wpfui: Make your application written in WPF keep up with modern design trenda2 points
On Stack Overflow · 1
- May 13, 2022WPF airspace issue and WinForms IDesignHost0 votes
Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.
Of the Copilot instructions files we read, the 2,297 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

