{"owner":"MaterialDesignInXAML","repo":"MaterialDesignInXamlToolkit","hasSkills":true,"totalSkillsCount":3,"totalTokensCount":3358,"categories":["anthropic-skill","copilot-instructions"],"hasMcp":false,"mcpConfig":null,"found":[".github/skills/mtp-test-running/SKILL.md",".github/skills/xamltest-ui-tests/SKILL.md",".github/copilot-instructions.md"],"skills":{".github/skills/mtp-test-running/SKILL.md":"---\nname: mtp-test-running\ndescription: Run MaterialDesignInXamlToolkit tests correctly with dotnet test, TUnit, and Microsoft Testing Platform. Use when validating changes, choosing a safe test scope, or filtering to the exact affected tests.\n---\n\n# Test running with MTP\n\nUse this skill when you need to run or suggest test commands in this repository.\n\n## Repository-specific runner setup\n\n1. Test projects use `UseMicrosoftTestingPlatformRunner=true`.\n2. Test projects also set `TestingPlatformDotnetTestSupport=true`.\n3. `global.json` does **not** opt into `test.runner = Microsoft.Testing.Platform`.\n4. That means this repo currently uses `dotnet test` in the legacy CLI mode while delegating execution to MTP-backed test applications.\n5. Runner-specific arguments must therefore be passed after an extra `--`.\n6. Do **not** rely on top-level `dotnet test --filter ...` for these projects.\n\n## Strong preferences\n\n1. Start with the smallest non-UI test scope that covers the change.\n2. Avoid `MaterialDesignThemes.UITests` unless the change is inherently runtime WPF behavior.\n3. Only run UI tests after the user explicitly asks or grants permission.\n4. When UI tests are necessary, run only the affected tests, never the whole UI suite.\n\n## TUnit filter syntax\n\nTUnit uses `--treenode-filter`.\n\nFormat:\n\n`/<Assembly>/<Namespace>/<Class>/<Test>`\n\n- Use `*` as a wildcard within a segment.\n- Use `(A)|(B)` inside a segment for OR.\n- Prefer exact class and test names over namespace-wide filters.\n- Add `--minimum-expected-tests <n>` so an empty selection fails loudly.\n\n## Command patterns\n\n### Example targeted non-UI test run\n\n```powershell\ndotnet test tests\\MaterialDesignThemes.Wpf.Tests\\MaterialDesignThemes.Wpf.Tests.csproj -c Release --no-build -- --treenode-filter \"/*/*/AutomationPropertiesNameConverterTests/*\" --minimum-expected-tests 1 --no-ansi --no-progress\n```\n\n### Example targeted UI validation\n\n```powershell\ndotnet test tests\\MaterialDesignThemes.UITests\\MaterialDesignThemes.UITests.csproj -c Release --no-build -- --treenode-filter \"/*/*/DecimalUpDownTests/(NumericButtons_WithMaximum_DisablesPlusButton)|(NumericButtons_WithMinimum_DisablesMinusButton)\" --minimum-expected-tests 2 --no-ansi --no-progress\n```\n\n### Verify a UI filter before running\n\n```powershell\ntests\\MaterialDesignThemes.UITests\\bin\\Release\\net10.0-windows\\MaterialDesignThemes.UITests.exe --list-tests --no-ansi --treenode-filter \"/*/*/DecimalUpDownTests/(NumericButtons_WithMaximum_DisablesPlusButton)|(NumericButtons_WithMinimum_DisablesMinusButton)\"\n```\n\n## Mistakes to avoid\n\n- Using top-level `dotnet test --filter ...` for these MTP-backed projects.\n- Passing runner-specific flags before the extra `--`.\n- Running broad UI suites when one or two targeted tests are enough.\n- Forgetting `--minimum-expected-tests`, which can hide a bad filter.\n\n## Useful references\n\n- `global.json`\n- `tests/MaterialDesignThemes.Wpf.Tests/MaterialDesignThemes.Wpf.Tests.csproj`\n- `tests/MaterialDesignThemes.UITests/MaterialDesignThemes.UITests.csproj`\n- https://learn.microsoft.com/dotnet/core/testing/unit-testing-with-dotnet-test\n- https://tunit.dev/docs/execution/test-filters\n",".github/skills/xamltest-ui-tests/SKILL.md":"---\nname: xamltest-ui-tests\ndescription: Write and update WPF UI tests in MaterialDesignThemes.UITests using XAMLTest. Use when template, layout, focus, interaction, or visual behavior needs coverage, or when a reviewer asks to move runtime UI checks out of MaterialDesignThemes.Wpf.Tests.\n---\n\n# XAMLTest UI tests\n\nUse this skill when working on runtime WPF behavior in this repository.\n\n## When to use it\n\n- A change touches templates, visual states, focus behavior, layout, coordinates, or input handling.\n- You need to inspect named template parts such as `PART_TextBox` or `PART_IncreaseButton`.\n- A reviewer asks to use XAMLTest instead of regular unit tests.\n- You need to assert WPF-only properties like `Padding`, `Visibility`, `ActualWidth`, or `DataContext` state after layout.\n\n## Repository-specific rules\n\n1. Put runtime UI behavior tests in `tests/MaterialDesignThemes.UITests`.\n2. Do **not** add visual-tree or layout interaction tests to `tests/MaterialDesignThemes.Wpf.Tests`.\n3. Prefer extending the existing feature file under `tests/MaterialDesignThemes.UITests/WPF/<feature>/` instead of creating a generic catch-all test file.\n4. Match the existing file's result-recording pattern; many current UI tests use `TestRecorder`, but it should not be treated as a blanket requirement.\n5. Ask permission before running UI tests, and only run the affected ones.\n\n## Standard pattern\n\n1. Inherit from `TestBase`.\n2. Use `LoadXaml<T>()` for focused control scenarios.\n3. Use `LoadUserControl<T>()` when you need a sample view model, bindings, or additional focus targets.\n4. Get named parts with `GetElement<T>(\"PART_Name\")`.\n5. Use `RemoteExecute` with static methods for properties that helpers do not expose directly.\n6. Use `Wait.For(...)` for layout-sensitive assertions.\n\n## What to prefer\n\n- `GetCoordinates()` for alignment and spacing assertions.\n- `RemoteExecute` for `Padding`, `Visibility`, `ActualWidth`, `Margin`, or `DataContext` inspection.\n- Keyboard and mouse helpers such as `MoveKeyboardFocus`, `SendKeyboardInput`, and `LeftClick` for interaction.\n\n## What to avoid\n\n- Inspecting the visual tree from `MaterialDesignThemes.Wpf.Tests` for runtime template behavior.\n- Overly broad UI suites when a single targeted XAMLTest scenario will do.\n- Repeating helper code inline when a small static local or private helper method is enough.\n\n## Example\n\n```csharp\n[Test]\npublic async Task DecimalUpDown_WithMaximum_DisablesPlusButton()\n{\n    await using var recorder = new TestRecorder(App);\n\n    var decimalUpDown = await LoadXaml<DecimalUpDown>(\"\"\"\n    <materialDesign:DecimalUpDown Value=\"1\" Maximum=\"2\" />\n    \"\"\");\n    var plusButton = await decimalUpDown.GetElement<RepeatButton>(\"PART_IncreaseButton\");\n    var textBox = await decimalUpDown.GetElement<TextBox>(\"PART_TextBox\");\n\n    await plusButton.LeftClick();\n    await Wait.For(async () =>\n    {\n        await Assert.That(await textBox.GetText()).IsEqualTo(\"2\");\n        await Assert.That(await decimalUpDown.GetValue()).IsEqualTo(2);\n    });\n\n    await Assert.That(await plusButton.GetIsEnabled()).IsFalse();\n\n    recorder.Success();\n}\n```\n\n## Useful local references\n\n- `tests/MaterialDesignThemes.UITests/TestBase.cs`\n- `tests/MaterialDesignThemes.UITests/XamlTestExtensions.cs`\n- Existing feature tests under `tests/MaterialDesignThemes.UITests/WPF/`\n",".github/copilot-instructions.md":"# Copilot Instructions for MaterialDesignInXamlToolkit\n\n## Repository Overview\n\nThe MaterialDesignInXamlToolkit is a **theme library** for WPF applications that provides Material Design themes and styling. This is NOT a control library - the focus is on theming existing WPF controls and providing custom controls only when necessary to support Google's Material Design specifications.\n\n### Key Principles\n- Theme library, not control library\n- Styling existing WPF controls to match Material Design\n- Custom controls only for Google-specified components that don't exist in WPF\n- No application or business logic belongs in this library\n- Provide base tools and springboard for developers to create their own controls\n\n## Architecture and Structure\n\n### Core Projects\n- **`MaterialDesignThemes.Wpf`** - Main theming library with styles, templates, and controls\n- **`MaterialDesignColors.Wpf`** - Color palette and theme management\n- **`MaterialDesignThemes.MahApps`** - Integration with MahApps.Metro\n- **`MainDemo.Wpf`** - Primary demonstration application\n- **`MaterialDesign3.Demo.Wpf`** - Material Design 3 demonstration\n- **`MaterialDesignToolkit.ResourceGeneration`** - Build-time resource generation tools\n\n### Key Technologies\n- **WPF (Windows Presentation Foundation)** - UI framework\n- **XAML** - Markup for UI definitions and styles  \n- **Material Design** - Google's design system implementation\n- **.NET 8** and **.NET Framework 4.7.2** - Target frameworks for the library\n- **.NET 9 SDK** - Required for building (as specified in `global.json`)\n- **C# 12.0** - Programming language\n- **PowerShell** - Build automation scripts\n\n## Development Environment\n\n### Requirements\n- **Windows** - Required for WPF development and compilation\n- **.NET 9 SDK** - As specified in `global.json` (note: projects target .NET 8 and .NET Framework 4.7.2)\n- **Visual Studio 2022** or **Visual Studio Code** with C# extension\n- **PowerShell** - For build scripts\n\n### Build and Test\n```powershell\n# Restore dependencies\ndotnet restore MaterialDesignToolkit.Full.slnx\n\n# Build (requires Windows)\ndotnet build MaterialDesignToolkit.Full.slnx --configuration Release --no-restore -p:Platform=\"Any CPU\" -p:TreatWarningsAsErrors=True\n\n# Run tests\ndotnet test MaterialDesignToolkit.Full.slnx --configuration Release --no-build\n\n# Build NuGet packages\n.\\build\\BuildNugets.ps1 -MDIXVersion \"x.x.x\" -MDIXColorsVersion \"x.x.x\" -MDIXMahAppsVersion \"x.x.x\"\n```\n\n## Code Style and Conventions\n\n### General Guidelines\n- Follow standard Visual Studio settings with ReSharper suggestions\n- Use .editorconfig settings (4-space indents for C#, 2-space for XAML/XML)\n- Allman brace style (`csharp_new_line_before_open_brace = all`)\n- No `this.` qualification unless necessary\n- Prefer explicit types over `var` for built-in types\n- Use PascalCase for public members, interfaces start with `I`\n\n### C# Conventions\n```csharp\n// Preferred dependency property pattern\npublic static readonly DependencyProperty MyPropertyProperty =\n    DependencyProperty.Register(\"MyProperty\", typeof(string), typeof(MyControl), \n        new UIPropertyMetadata(\"DefaultValue\", OnMyPropertyChanged));\n\npublic string MyProperty\n{\n    get => (string)GetValue(MyPropertyProperty);\n    set => SetValue(MyPropertyProperty, value);\n}\n\nprivate static void OnMyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n{\n    var control = (MyControl)d;\n    // Handle property change\n}\n```\n\n### XAML Style Guidelines\n- Use XamlStyler settings from `Settings.XamlStyler`\n- 2-space indentation for XAML\n- Keep first attribute on same line as element\n- Order attributes according to defined groups\n- Use `{StaticResource}` over `{DynamicResource}` where possible\n- Follow resource naming: `MaterialDesign.Brush.Primary.Light`\n\n## WPF and Material Design Context\n\n### Theme Architecture\n- **Base Themes**: Light and Dark variants\n- **Color System**: Primary, Secondary, Surface, Background colors with variants\n- **Elevation**: Shadow and overlay systems for depth\n- **Typography**: Material Design text styles\n- **Motion**: Transitions and animations\n\n### Common Patterns\n```csharp\n// Theme modification pattern\nprivate static void ModifyTheme(Action<Theme> modificationAction)\n{\n    var paletteHelper = new PaletteHelper();\n    Theme theme = paletteHelper.GetTheme();\n    \n    modificationAction?.Invoke(theme);\n    \n    paletteHelper.SetTheme(theme);\n}\n\n// Color adjustment usage\ntheme.ColorAdjustment = new ColorAdjustment\n{\n    DesiredContrastRatio = desiredRatio,\n    Contrast = contrastValue,\n    Colors = colorSelection\n};\n```\n\n### Resource Dictionary Patterns\n```xml\n<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                    xmlns:materialDesign=\"http://materialdesigninxaml.net/winfx/xaml/themes\">\n  \n  <ResourceDictionary.MergedDictionaries>\n    <materialDesign:BundledTheme BaseTheme=\"Light\" PrimaryColor=\"DeepPurple\" SecondaryColor=\"Lime\" />\n    <ResourceDictionary Source=\"pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/Generic.xaml\" />\n  </ResourceDictionary.MergedDictionaries>\n\n</ResourceDictionary>\n```\n\n## Testing Approach\n\n### Test Structure\n- **Unit Tests**: `MaterialDesignThemes.Wpf.Tests`, `MaterialDesignColors.Wpf.Tests`\n- **UI Tests**: `MaterialDesignThemes.UITests` - Visual/integration testing\n- **Demo Applications**: Manual testing and showcasing functionality\n\n### Test Patterns\n```csharp\n[Test]\npublic async Task ThemeTest_Example()\n{\n    await App.InitializeWithMaterialDesign(\n        baseTheme: BaseTheme.Light,\n        primary: PrimaryColor.Blue,\n        secondary: SecondaryColor.Orange);\n        \n    // Test implementation\n}\n```\n\n## Build Pipeline and Automation\n\n### GitHub Actions Workflows\n- **PR Verification**: `pr_verification.yml` - Build and test on PRs\n- **Build Artifacts**: `build_artifacts.yml` - Main build pipeline\n- **Release**: `release.yml` - Create releases and publish NuGets\n\n### PowerShell Build Scripts\n- **`BuildNugets.ps1`** - Package creation\n- **`ApplyXamlStyler.ps1`** - Code formatting\n- **`MigrateBrushes.ps1`** - Resource migration utilities\n- **`UpdateNugets.ps1`** - Package management\n\n## Domain-Specific Knowledge\n\n### Material Design Implementation\n- Follow Google Material Design guidelines strictly\n- Implement elevation through shadows and overlays\n- Use consistent color theming system\n- Support both Material Design 2 and 3 specifications\n- Ensure accessibility compliance (contrast ratios, touch targets)\n\n### WPF Theming Best Practices\n- Use `TemplateBinding` for connecting to parent properties\n- Implement proper focus visuals and keyboard navigation\n- Support high contrast mode and accessibility features\n- Use appropriate triggers for state changes (hover, pressed, disabled)\n- Leverage WPF's dependency property system effectively\n\n### Resource Organization\n- Brush resources: `MaterialDesign.Brush.*`\n- Style resources: Clear, descriptive names matching WPF conventions\n- Template resources: Match control types and variants\n- Color resources: Follow Material Design naming (Primary, Secondary, Surface, etc.)\n\n## API Design Guidelines\n\n- **Maintain backward compatibility** - This is a widely-used library\n- **Minimal public API surface** - Only expose what's necessary\n- **Consistent naming** - Follow WPF and Material Design conventions\n- **Proper documentation** - XML docs for all public APIs\n- **Designer support** - Ensure controls work well in Visual Studio designer\n\n## Common Tasks and Patterns\n\n### Adding a New Style\n1. Define in appropriate XAML resource dictionary\n2. Follow existing naming conventions\n3. Test in demo applications\n4. Ensure accessibility compliance\n5. Add to migration scripts if replacing existing styles\n\n### Theme Modifications\n1. Use `PaletteHelper` for runtime theme changes\n2. Support both static and dynamic resource binding\n3. Test with both Light and Dark themes\n4. Verify color adjustments work properly\n\n### Custom Control Development\n1. Only when no WPF equivalent exists\n2. Follow Material Design specifications exactly\n3. Implement proper template parts and visual states\n4. Support theming and color adjustments\n5. Include comprehensive tests and demo usage\n\nRemember: This library's primary goal is to provide a complete, high-quality Material Design theming solution for WPF applications while maintaining excellent performance and broad compatibility."},"files":{".github/skills/mtp-test-running/SKILL.md":"---\nname: mtp-test-running\ndescription: Run MaterialDesignInXamlToolkit tests correctly with dotnet test, TUnit, and Microsoft Testing Platform. Use when validating changes, choosing a safe test scope, or filtering to the exact affected tests.\n---\n\n# Test running with MTP\n\nUse this skill when you need to run or suggest test commands in this repository.\n\n## Repository-specific runner setup\n\n1. Test projects use `UseMicrosoftTestingPlatformRunner=true`.\n2. Test projects also set `TestingPlatformDotnetTestSupport=true`.\n3. `global.json` does **not** opt into `test.runner = Microsoft.Testing.Platform`.\n4. That means this repo currently uses `dotnet test` in the legacy CLI mode while delegating execution to MTP-backed test applications.\n5. Runner-specific arguments must therefore be passed after an extra `--`.\n6. Do **not** rely on top-level `dotnet test --filter ...` for these projects.\n\n## Strong preferences\n\n1. Start with the smallest non-UI test scope that covers the change.\n2. Avoid `MaterialDesignThemes.UITests` unless the change is inherently runtime WPF behavior.\n3. Only run UI tests after the user explicitly asks or grants permission.\n4. When UI tests are necessary, run only the affected tests, never the whole UI suite.\n\n## TUnit filter syntax\n\nTUnit uses `--treenode-filter`.\n\nFormat:\n\n`/<Assembly>/<Namespace>/<Class>/<Test>`\n\n- Use `*` as a wildcard within a segment.\n- Use `(A)|(B)` inside a segment for OR.\n- Prefer exact class and test names over namespace-wide filters.\n- Add `--minimum-expected-tests <n>` so an empty selection fails loudly.\n\n## Command patterns\n\n### Example targeted non-UI test run\n\n```powershell\ndotnet test tests\\MaterialDesignThemes.Wpf.Tests\\MaterialDesignThemes.Wpf.Tests.csproj -c Release --no-build -- --treenode-filter \"/*/*/AutomationPropertiesNameConverterTests/*\" --minimum-expected-tests 1 --no-ansi --no-progress\n```\n\n### Example targeted UI validation\n\n```powershell\ndotnet test tests\\MaterialDesignThemes.UITests\\MaterialDesignThemes.UITests.csproj -c Release --no-build -- --treenode-filter \"/*/*/DecimalUpDownTests/(NumericButtons_WithMaximum_DisablesPlusButton)|(NumericButtons_WithMinimum_DisablesMinusButton)\" --minimum-expected-tests 2 --no-ansi --no-progress\n```\n\n### Verify a UI filter before running\n\n```powershell\ntests\\MaterialDesignThemes.UITests\\bin\\Release\\net10.0-windows\\MaterialDesignThemes.UITests.exe --list-tests --no-ansi --treenode-filter \"/*/*/DecimalUpDownTests/(NumericButtons_WithMaximum_DisablesPlusButton)|(NumericButtons_WithMinimum_DisablesMinusButton)\"\n```\n\n## Mistakes to avoid\n\n- Using top-level `dotnet test --filter ...` for these MTP-backed projects.\n- Passing runner-specific flags before the extra `--`.\n- Running broad UI suites when one or two targeted tests are enough.\n- Forgetting `--minimum-expected-tests`, which can hide a bad filter.\n\n## Useful references\n\n- `global.json`\n- `tests/MaterialDesignThemes.Wpf.Tests/MaterialDesignThemes.Wpf.Tests.csproj`\n- `tests/MaterialDesignThemes.UITests/MaterialDesignThemes.UITests.csproj`\n- https://learn.microsoft.com/dotnet/core/testing/unit-testing-with-dotnet-test\n- https://tunit.dev/docs/execution/test-filters\n",".github/skills/xamltest-ui-tests/SKILL.md":"---\nname: xamltest-ui-tests\ndescription: Write and update WPF UI tests in MaterialDesignThemes.UITests using XAMLTest. Use when template, layout, focus, interaction, or visual behavior needs coverage, or when a reviewer asks to move runtime UI checks out of MaterialDesignThemes.Wpf.Tests.\n---\n\n# XAMLTest UI tests\n\nUse this skill when working on runtime WPF behavior in this repository.\n\n## When to use it\n\n- A change touches templates, visual states, focus behavior, layout, coordinates, or input handling.\n- You need to inspect named template parts such as `PART_TextBox` or `PART_IncreaseButton`.\n- A reviewer asks to use XAMLTest instead of regular unit tests.\n- You need to assert WPF-only properties like `Padding`, `Visibility`, `ActualWidth`, or `DataContext` state after layout.\n\n## Repository-specific rules\n\n1. Put runtime UI behavior tests in `tests/MaterialDesignThemes.UITests`.\n2. Do **not** add visual-tree or layout interaction tests to `tests/MaterialDesignThemes.Wpf.Tests`.\n3. Prefer extending the existing feature file under `tests/MaterialDesignThemes.UITests/WPF/<feature>/` instead of creating a generic catch-all test file.\n4. Match the existing file's result-recording pattern; many current UI tests use `TestRecorder`, but it should not be treated as a blanket requirement.\n5. Ask permission before running UI tests, and only run the affected ones.\n\n## Standard pattern\n\n1. Inherit from `TestBase`.\n2. Use `LoadXaml<T>()` for focused control scenarios.\n3. Use `LoadUserControl<T>()` when you need a sample view model, bindings, or additional focus targets.\n4. Get named parts with `GetElement<T>(\"PART_Name\")`.\n5. Use `RemoteExecute` with static methods for properties that helpers do not expose directly.\n6. Use `Wait.For(...)` for layout-sensitive assertions.\n\n## What to prefer\n\n- `GetCoordinates()` for alignment and spacing assertions.\n- `RemoteExecute` for `Padding`, `Visibility`, `ActualWidth`, `Margin`, or `DataContext` inspection.\n- Keyboard and mouse helpers such as `MoveKeyboardFocus`, `SendKeyboardInput`, and `LeftClick` for interaction.\n\n## What to avoid\n\n- Inspecting the visual tree from `MaterialDesignThemes.Wpf.Tests` for runtime template behavior.\n- Overly broad UI suites when a single targeted XAMLTest scenario will do.\n- Repeating helper code inline when a small static local or private helper method is enough.\n\n## Example\n\n```csharp\n[Test]\npublic async Task DecimalUpDown_WithMaximum_DisablesPlusButton()\n{\n    await using var recorder = new TestRecorder(App);\n\n    var decimalUpDown = await LoadXaml<DecimalUpDown>(\"\"\"\n    <materialDesign:DecimalUpDown Value=\"1\" Maximum=\"2\" />\n    \"\"\");\n    var plusButton = await decimalUpDown.GetElement<RepeatButton>(\"PART_IncreaseButton\");\n    var textBox = await decimalUpDown.GetElement<TextBox>(\"PART_TextBox\");\n\n    await plusButton.LeftClick();\n    await Wait.For(async () =>\n    {\n        await Assert.That(await textBox.GetText()).IsEqualTo(\"2\");\n        await Assert.That(await decimalUpDown.GetValue()).IsEqualTo(2);\n    });\n\n    await Assert.That(await plusButton.GetIsEnabled()).IsFalse();\n\n    recorder.Success();\n}\n```\n\n## Useful local references\n\n- `tests/MaterialDesignThemes.UITests/TestBase.cs`\n- `tests/MaterialDesignThemes.UITests/XamlTestExtensions.cs`\n- Existing feature tests under `tests/MaterialDesignThemes.UITests/WPF/`\n",".github/copilot-instructions.md":"# Copilot Instructions for MaterialDesignInXamlToolkit\n\n## Repository Overview\n\nThe MaterialDesignInXamlToolkit is a **theme library** for WPF applications that provides Material Design themes and styling. This is NOT a control library - the focus is on theming existing WPF controls and providing custom controls only when necessary to support Google's Material Design specifications.\n\n### Key Principles\n- Theme library, not control library\n- Styling existing WPF controls to match Material Design\n- Custom controls only for Google-specified components that don't exist in WPF\n- No application or business logic belongs in this library\n- Provide base tools and springboard for developers to create their own controls\n\n## Architecture and Structure\n\n### Core Projects\n- **`MaterialDesignThemes.Wpf`** - Main theming library with styles, templates, and controls\n- **`MaterialDesignColors.Wpf`** - Color palette and theme management\n- **`MaterialDesignThemes.MahApps`** - Integration with MahApps.Metro\n- **`MainDemo.Wpf`** - Primary demonstration application\n- **`MaterialDesign3.Demo.Wpf`** - Material Design 3 demonstration\n- **`MaterialDesignToolkit.ResourceGeneration`** - Build-time resource generation tools\n\n### Key Technologies\n- **WPF (Windows Presentation Foundation)** - UI framework\n- **XAML** - Markup for UI definitions and styles  \n- **Material Design** - Google's design system implementation\n- **.NET 8** and **.NET Framework 4.7.2** - Target frameworks for the library\n- **.NET 9 SDK** - Required for building (as specified in `global.json`)\n- **C# 12.0** - Programming language\n- **PowerShell** - Build automation scripts\n\n## Development Environment\n\n### Requirements\n- **Windows** - Required for WPF development and compilation\n- **.NET 9 SDK** - As specified in `global.json` (note: projects target .NET 8 and .NET Framework 4.7.2)\n- **Visual Studio 2022** or **Visual Studio Code** with C# extension\n- **PowerShell** - For build scripts\n\n### Build and Test\n```powershell\n# Restore dependencies\ndotnet restore MaterialDesignToolkit.Full.slnx\n\n# Build (requires Windows)\ndotnet build MaterialDesignToolkit.Full.slnx --configuration Release --no-restore -p:Platform=\"Any CPU\" -p:TreatWarningsAsErrors=True\n\n# Run tests\ndotnet test MaterialDesignToolkit.Full.slnx --configuration Release --no-build\n\n# Build NuGet packages\n.\\build\\BuildNugets.ps1 -MDIXVersion \"x.x.x\" -MDIXColorsVersion \"x.x.x\" -MDIXMahAppsVersion \"x.x.x\"\n```\n\n## Code Style and Conventions\n\n### General Guidelines\n- Follow standard Visual Studio settings with ReSharper suggestions\n- Use .editorconfig settings (4-space indents for C#, 2-space for XAML/XML)\n- Allman brace style (`csharp_new_line_before_open_brace = all`)\n- No `this.` qualification unless necessary\n- Prefer explicit types over `var` for built-in types\n- Use PascalCase for public members, interfaces start with `I`\n\n### C# Conventions\n```csharp\n// Preferred dependency property pattern\npublic static readonly DependencyProperty MyPropertyProperty =\n    DependencyProperty.Register(\"MyProperty\", typeof(string), typeof(MyControl), \n        new UIPropertyMetadata(\"DefaultValue\", OnMyPropertyChanged));\n\npublic string MyProperty\n{\n    get => (string)GetValue(MyPropertyProperty);\n    set => SetValue(MyPropertyProperty, value);\n}\n\nprivate static void OnMyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n{\n    var control = (MyControl)d;\n    // Handle property change\n}\n```\n\n### XAML Style Guidelines\n- Use XamlStyler settings from `Settings.XamlStyler`\n- 2-space indentation for XAML\n- Keep first attribute on same line as element\n- Order attributes according to defined groups\n- Use `{StaticResource}` over `{DynamicResource}` where possible\n- Follow resource naming: `MaterialDesign.Brush.Primary.Light`\n\n## WPF and Material Design Context\n\n### Theme Architecture\n- **Base Themes**: Light and Dark variants\n- **Color System**: Primary, Secondary, Surface, Background colors with variants\n- **Elevation**: Shadow and overlay systems for depth\n- **Typography**: Material Design text styles\n- **Motion**: Transitions and animations\n\n### Common Patterns\n```csharp\n// Theme modification pattern\nprivate static void ModifyTheme(Action<Theme> modificationAction)\n{\n    var paletteHelper = new PaletteHelper();\n    Theme theme = paletteHelper.GetTheme();\n    \n    modificationAction?.Invoke(theme);\n    \n    paletteHelper.SetTheme(theme);\n}\n\n// Color adjustment usage\ntheme.ColorAdjustment = new ColorAdjustment\n{\n    DesiredContrastRatio = desiredRatio,\n    Contrast = contrastValue,\n    Colors = colorSelection\n};\n```\n\n### Resource Dictionary Patterns\n```xml\n<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                    xmlns:materialDesign=\"http://materialdesigninxaml.net/winfx/xaml/themes\">\n  \n  <ResourceDictionary.MergedDictionaries>\n    <materialDesign:BundledTheme BaseTheme=\"Light\" PrimaryColor=\"DeepPurple\" SecondaryColor=\"Lime\" />\n    <ResourceDictionary Source=\"pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/Generic.xaml\" />\n  </ResourceDictionary.MergedDictionaries>\n\n</ResourceDictionary>\n```\n\n## Testing Approach\n\n### Test Structure\n- **Unit Tests**: `MaterialDesignThemes.Wpf.Tests`, `MaterialDesignColors.Wpf.Tests`\n- **UI Tests**: `MaterialDesignThemes.UITests` - Visual/integration testing\n- **Demo Applications**: Manual testing and showcasing functionality\n\n### Test Patterns\n```csharp\n[Test]\npublic async Task ThemeTest_Example()\n{\n    await App.InitializeWithMaterialDesign(\n        baseTheme: BaseTheme.Light,\n        primary: PrimaryColor.Blue,\n        secondary: SecondaryColor.Orange);\n        \n    // Test implementation\n}\n```\n\n## Build Pipeline and Automation\n\n### GitHub Actions Workflows\n- **PR Verification**: `pr_verification.yml` - Build and test on PRs\n- **Build Artifacts**: `build_artifacts.yml` - Main build pipeline\n- **Release**: `release.yml` - Create releases and publish NuGets\n\n### PowerShell Build Scripts\n- **`BuildNugets.ps1`** - Package creation\n- **`ApplyXamlStyler.ps1`** - Code formatting\n- **`MigrateBrushes.ps1`** - Resource migration utilities\n- **`UpdateNugets.ps1`** - Package management\n\n## Domain-Specific Knowledge\n\n### Material Design Implementation\n- Follow Google Material Design guidelines strictly\n- Implement elevation through shadows and overlays\n- Use consistent color theming system\n- Support both Material Design 2 and 3 specifications\n- Ensure accessibility compliance (contrast ratios, touch targets)\n\n### WPF Theming Best Practices\n- Use `TemplateBinding` for connecting to parent properties\n- Implement proper focus visuals and keyboard navigation\n- Support high contrast mode and accessibility features\n- Use appropriate triggers for state changes (hover, pressed, disabled)\n- Leverage WPF's dependency property system effectively\n\n### Resource Organization\n- Brush resources: `MaterialDesign.Brush.*`\n- Style resources: Clear, descriptive names matching WPF conventions\n- Template resources: Match control types and variants\n- Color resources: Follow Material Design naming (Primary, Secondary, Surface, etc.)\n\n## API Design Guidelines\n\n- **Maintain backward compatibility** - This is a widely-used library\n- **Minimal public API surface** - Only expose what's necessary\n- **Consistent naming** - Follow WPF and Material Design conventions\n- **Proper documentation** - XML docs for all public APIs\n- **Designer support** - Ensure controls work well in Visual Studio designer\n\n## Common Tasks and Patterns\n\n### Adding a New Style\n1. Define in appropriate XAML resource dictionary\n2. Follow existing naming conventions\n3. Test in demo applications\n4. Ensure accessibility compliance\n5. Add to migration scripts if replacing existing styles\n\n### Theme Modifications\n1. Use `PaletteHelper` for runtime theme changes\n2. Support both static and dynamic resource binding\n3. Test with both Light and Dark themes\n4. Verify color adjustments work properly\n\n### Custom Control Development\n1. Only when no WPF equivalent exists\n2. Follow Material Design specifications exactly\n3. Implement proper template parts and visual states\n4. Support theming and color adjustments\n5. Include comprehensive tests and demo usage\n\nRemember: This library's primary goal is to provide a complete, high-quality Material Design theming solution for WPF applications while maintaining excellent performance and broad compatibility."},"items":[{"name":"SKILL.md","path":".github/skills/mtp-test-running/SKILL.md","rawUrl":"https://raw.githubusercontent.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/HEAD/.github/skills/mtp-test-running/SKILL.md","title":"mtp-test-running","category":"anthropic-skill","format":"markdown","content":"---\nname: mtp-test-running\ndescription: Run MaterialDesignInXamlToolkit tests correctly with dotnet test, TUnit, and Microsoft Testing Platform. Use when validating changes, choosing a safe test scope, or filtering to the exact affected tests.\n---\n\n# Test running with MTP\n\nUse this skill when you need to run or suggest test commands in this repository.\n\n## Repository-specific runner setup\n\n1. Test projects use `UseMicrosoftTestingPlatformRunner=true`.\n2. Test projects also set `TestingPlatformDotnetTestSupport=true`.\n3. `global.json` does **not** opt into `test.runner = Microsoft.Testing.Platform`.\n4. That means this repo currently uses `dotnet test` in the legacy CLI mode while delegating execution to MTP-backed test applications.\n5. Runner-specific arguments must therefore be passed after an extra `--`.\n6. Do **not** rely on top-level `dotnet test --filter ...` for these projects.\n\n## Strong preferences\n\n1. Start with the smallest non-UI test scope that covers the change.\n2. Avoid `MaterialDesignThemes.UITests` unless the change is inherently runtime WPF behavior.\n3. Only run UI tests after the user explicitly asks or grants permission.\n4. When UI tests are necessary, run only the affected tests, never the whole UI suite.\n\n## TUnit filter syntax\n\nTUnit uses `--treenode-filter`.\n\nFormat:\n\n`/<Assembly>/<Namespace>/<Class>/<Test>`\n\n- Use `*` as a wildcard within a segment.\n- Use `(A)|(B)` inside a segment for OR.\n- Prefer exact class and test names over namespace-wide filters.\n- Add `--minimum-expected-tests <n>` so an empty selection fails loudly.\n\n## Command patterns\n\n### Example targeted non-UI test run\n\n```powershell\ndotnet test tests\\MaterialDesignThemes.Wpf.Tests\\MaterialDesignThemes.Wpf.Tests.csproj -c Release --no-build -- --treenode-filter \"/*/*/AutomationPropertiesNameConverterTests/*\" --minimum-expected-tests 1 --no-ansi --no-progress\n```\n\n### Example targeted UI validation\n\n```powershell\ndotnet test tests\\MaterialDesignThemes.UITests\\MaterialDesignThemes.UITests.csproj -c Release --no-build -- --treenode-filter \"/*/*/DecimalUpDownTests/(NumericButtons_WithMaximum_DisablesPlusButton)|(NumericButtons_WithMinimum_DisablesMinusButton)\" --minimum-expected-tests 2 --no-ansi --no-progress\n```\n\n### Verify a UI filter before running\n\n```powershell\ntests\\MaterialDesignThemes.UITests\\bin\\Release\\net10.0-windows\\MaterialDesignThemes.UITests.exe --list-tests --no-ansi --treenode-filter \"/*/*/DecimalUpDownTests/(NumericButtons_WithMaximum_DisablesPlusButton)|(NumericButtons_WithMinimum_DisablesMinusButton)\"\n```\n\n## Mistakes to avoid\n\n- Using top-level `dotnet test --filter ...` for these MTP-backed projects.\n- Passing runner-specific flags before the extra `--`.\n- Running broad UI suites when one or two targeted tests are enough.\n- Forgetting `--minimum-expected-tests`, which can hide a bad filter.\n\n## Useful references\n\n- `global.json`\n- `tests/MaterialDesignThemes.Wpf.Tests/MaterialDesignThemes.Wpf.Tests.csproj`\n- `tests/MaterialDesignThemes.UITests/MaterialDesignThemes.UITests.csproj`\n- https://learn.microsoft.com/dotnet/core/testing/unit-testing-with-dotnet-test\n- https://tunit.dev/docs/execution/test-filters\n","frontmatter":{"name":"mtp-test-running","description":"Run MaterialDesignInXamlToolkit tests correctly with dotnet test, TUnit, and Microsoft Testing Platform. Use when validating changes, choosing a safe test scope, or filtering to the exact affected tests."},"isInternal":false,"tokens":744,"sizeBytes":3168},{"name":"SKILL.md","path":".github/skills/xamltest-ui-tests/SKILL.md","rawUrl":"https://raw.githubusercontent.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/HEAD/.github/skills/xamltest-ui-tests/SKILL.md","title":"xamltest-ui-tests","category":"anthropic-skill","format":"markdown","content":"---\nname: xamltest-ui-tests\ndescription: Write and update WPF UI tests in MaterialDesignThemes.UITests using XAMLTest. Use when template, layout, focus, interaction, or visual behavior needs coverage, or when a reviewer asks to move runtime UI checks out of MaterialDesignThemes.Wpf.Tests.\n---\n\n# XAMLTest UI tests\n\nUse this skill when working on runtime WPF behavior in this repository.\n\n## When to use it\n\n- A change touches templates, visual states, focus behavior, layout, coordinates, or input handling.\n- You need to inspect named template parts such as `PART_TextBox` or `PART_IncreaseButton`.\n- A reviewer asks to use XAMLTest instead of regular unit tests.\n- You need to assert WPF-only properties like `Padding`, `Visibility`, `ActualWidth`, or `DataContext` state after layout.\n\n## Repository-specific rules\n\n1. Put runtime UI behavior tests in `tests/MaterialDesignThemes.UITests`.\n2. Do **not** add visual-tree or layout interaction tests to `tests/MaterialDesignThemes.Wpf.Tests`.\n3. Prefer extending the existing feature file under `tests/MaterialDesignThemes.UITests/WPF/<feature>/` instead of creating a generic catch-all test file.\n4. Match the existing file's result-recording pattern; many current UI tests use `TestRecorder`, but it should not be treated as a blanket requirement.\n5. Ask permission before running UI tests, and only run the affected ones.\n\n## Standard pattern\n\n1. Inherit from `TestBase`.\n2. Use `LoadXaml<T>()` for focused control scenarios.\n3. Use `LoadUserControl<T>()` when you need a sample view model, bindings, or additional focus targets.\n4. Get named parts with `GetElement<T>(\"PART_Name\")`.\n5. Use `RemoteExecute` with static methods for properties that helpers do not expose directly.\n6. Use `Wait.For(...)` for layout-sensitive assertions.\n\n## What to prefer\n\n- `GetCoordinates()` for alignment and spacing assertions.\n- `RemoteExecute` for `Padding`, `Visibility`, `ActualWidth`, `Margin`, or `DataContext` inspection.\n- Keyboard and mouse helpers such as `MoveKeyboardFocus`, `SendKeyboardInput`, and `LeftClick` for interaction.\n\n## What to avoid\n\n- Inspecting the visual tree from `MaterialDesignThemes.Wpf.Tests` for runtime template behavior.\n- Overly broad UI suites when a single targeted XAMLTest scenario will do.\n- Repeating helper code inline when a small static local or private helper method is enough.\n\n## Example\n\n```csharp\n[Test]\npublic async Task DecimalUpDown_WithMaximum_DisablesPlusButton()\n{\n    await using var recorder = new TestRecorder(App);\n\n    var decimalUpDown = await LoadXaml<DecimalUpDown>(\"\"\"\n    <materialDesign:DecimalUpDown Value=\"1\" Maximum=\"2\" />\n    \"\"\");\n    var plusButton = await decimalUpDown.GetElement<RepeatButton>(\"PART_IncreaseButton\");\n    var textBox = await decimalUpDown.GetElement<TextBox>(\"PART_TextBox\");\n\n    await plusButton.LeftClick();\n    await Wait.For(async () =>\n    {\n        await Assert.That(await textBox.GetText()).IsEqualTo(\"2\");\n        await Assert.That(await decimalUpDown.GetValue()).IsEqualTo(2);\n    });\n\n    await Assert.That(await plusButton.GetIsEnabled()).IsFalse();\n\n    recorder.Success();\n}\n```\n\n## Useful local references\n\n- `tests/MaterialDesignThemes.UITests/TestBase.cs`\n- `tests/MaterialDesignThemes.UITests/XamlTestExtensions.cs`\n- Existing feature tests under `tests/MaterialDesignThemes.UITests/WPF/`\n","frontmatter":{"name":"xamltest-ui-tests","description":"Write and update WPF UI tests in MaterialDesignThemes.UITests using XAMLTest. Use when template, layout, focus, interaction, or visual behavior needs coverage, or when a reviewer asks to move runtime UI checks out of MaterialDesignThemes.Wpf.Tests."},"isInternal":false,"tokens":754,"sizeBytes":3342},{"name":"copilot-instructions.md","path":".github/copilot-instructions.md","rawUrl":"https://raw.githubusercontent.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/HEAD/.github/copilot-instructions.md","title":"GitHub Copilot Instructions","category":"copilot-instructions","format":"markdown","content":"# Copilot Instructions for MaterialDesignInXamlToolkit\n\n## Repository Overview\n\nThe MaterialDesignInXamlToolkit is a **theme library** for WPF applications that provides Material Design themes and styling. This is NOT a control library - the focus is on theming existing WPF controls and providing custom controls only when necessary to support Google's Material Design specifications.\n\n### Key Principles\n- Theme library, not control library\n- Styling existing WPF controls to match Material Design\n- Custom controls only for Google-specified components that don't exist in WPF\n- No application or business logic belongs in this library\n- Provide base tools and springboard for developers to create their own controls\n\n## Architecture and Structure\n\n### Core Projects\n- **`MaterialDesignThemes.Wpf`** - Main theming library with styles, templates, and controls\n- **`MaterialDesignColors.Wpf`** - Color palette and theme management\n- **`MaterialDesignThemes.MahApps`** - Integration with MahApps.Metro\n- **`MainDemo.Wpf`** - Primary demonstration application\n- **`MaterialDesign3.Demo.Wpf`** - Material Design 3 demonstration\n- **`MaterialDesignToolkit.ResourceGeneration`** - Build-time resource generation tools\n\n### Key Technologies\n- **WPF (Windows Presentation Foundation)** - UI framework\n- **XAML** - Markup for UI definitions and styles  \n- **Material Design** - Google's design system implementation\n- **.NET 8** and **.NET Framework 4.7.2** - Target frameworks for the library\n- **.NET 9 SDK** - Required for building (as specified in `global.json`)\n- **C# 12.0** - Programming language\n- **PowerShell** - Build automation scripts\n\n## Development Environment\n\n### Requirements\n- **Windows** - Required for WPF development and compilation\n- **.NET 9 SDK** - As specified in `global.json` (note: projects target .NET 8 and .NET Framework 4.7.2)\n- **Visual Studio 2022** or **Visual Studio Code** with C# extension\n- **PowerShell** - For build scripts\n\n### Build and Test\n```powershell\n# Restore dependencies\ndotnet restore MaterialDesignToolkit.Full.slnx\n\n# Build (requires Windows)\ndotnet build MaterialDesignToolkit.Full.slnx --configuration Release --no-restore -p:Platform=\"Any CPU\" -p:TreatWarningsAsErrors=True\n\n# Run tests\ndotnet test MaterialDesignToolkit.Full.slnx --configuration Release --no-build\n\n# Build NuGet packages\n.\\build\\BuildNugets.ps1 -MDIXVersion \"x.x.x\" -MDIXColorsVersion \"x.x.x\" -MDIXMahAppsVersion \"x.x.x\"\n```\n\n## Code Style and Conventions\n\n### General Guidelines\n- Follow standard Visual Studio settings with ReSharper suggestions\n- Use .editorconfig settings (4-space indents for C#, 2-space for XAML/XML)\n- Allman brace style (`csharp_new_line_before_open_brace = all`)\n- No `this.` qualification unless necessary\n- Prefer explicit types over `var` for built-in types\n- Use PascalCase for public members, interfaces start with `I`\n\n### C# Conventions\n```csharp\n// Preferred dependency property pattern\npublic static readonly DependencyProperty MyPropertyProperty =\n    DependencyProperty.Register(\"MyProperty\", typeof(string), typeof(MyControl), \n        new UIPropertyMetadata(\"DefaultValue\", OnMyPropertyChanged));\n\npublic string MyProperty\n{\n    get => (string)GetValue(MyPropertyProperty);\n    set => SetValue(MyPropertyProperty, value);\n}\n\nprivate static void OnMyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n{\n    var control = (MyControl)d;\n    // Handle property change\n}\n```\n\n### XAML Style Guidelines\n- Use XamlStyler settings from `Settings.XamlStyler`\n- 2-space indentation for XAML\n- Keep first attribute on same line as element\n- Order attributes according to defined groups\n- Use `{StaticResource}` over `{DynamicResource}` where possible\n- Follow resource naming: `MaterialDesign.Brush.Primary.Light`\n\n## WPF and Material Design Context\n\n### Theme Architecture\n- **Base Themes**: Light and Dark variants\n- **Color System**: Primary, Secondary, Surface, Background colors with variants\n- **Elevation**: Shadow and overlay systems for depth\n- **Typography**: Material Design text styles\n- **Motion**: Transitions and animations\n\n### Common Patterns\n```csharp\n// Theme modification pattern\nprivate static void ModifyTheme(Action<Theme> modificationAction)\n{\n    var paletteHelper = new PaletteHelper();\n    Theme theme = paletteHelper.GetTheme();\n    \n    modificationAction?.Invoke(theme);\n    \n    paletteHelper.SetTheme(theme);\n}\n\n// Color adjustment usage\ntheme.ColorAdjustment = new ColorAdjustment\n{\n    DesiredContrastRatio = desiredRatio,\n    Contrast = contrastValue,\n    Colors = colorSelection\n};\n```\n\n### Resource Dictionary Patterns\n```xml\n<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                    xmlns:materialDesign=\"http://materialdesigninxaml.net/winfx/xaml/themes\">\n  \n  <ResourceDictionary.MergedDictionaries>\n    <materialDesign:BundledTheme BaseTheme=\"Light\" PrimaryColor=\"DeepPurple\" SecondaryColor=\"Lime\" />\n    <ResourceDictionary Source=\"pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/Generic.xaml\" />\n  </ResourceDictionary.MergedDictionaries>\n\n</ResourceDictionary>\n```\n\n## Testing Approach\n\n### Test Structure\n- **Unit Tests**: `MaterialDesignThemes.Wpf.Tests`, `MaterialDesignColors.Wpf.Tests`\n- **UI Tests**: `MaterialDesignThemes.UITests` - Visual/integration testing\n- **Demo Applications**: Manual testing and showcasing functionality\n\n### Test Patterns\n```csharp\n[Test]\npublic async Task ThemeTest_Example()\n{\n    await App.InitializeWithMaterialDesign(\n        baseTheme: BaseTheme.Light,\n        primary: PrimaryColor.Blue,\n        secondary: SecondaryColor.Orange);\n        \n    // Test implementation\n}\n```\n\n## Build Pipeline and Automation\n\n### GitHub Actions Workflows\n- **PR Verification**: `pr_verification.yml` - Build and test on PRs\n- **Build Artifacts**: `build_artifacts.yml` - Main build pipeline\n- **Release**: `release.yml` - Create releases and publish NuGets\n\n### PowerShell Build Scripts\n- **`BuildNugets.ps1`** - Package creation\n- **`ApplyXamlStyler.ps1`** - Code formatting\n- **`MigrateBrushes.ps1`** - Resource migration utilities\n- **`UpdateNugets.ps1`** - Package management\n\n## Domain-Specific Knowledge\n\n### Material Design Implementation\n- Follow Google Material Design guidelines strictly\n- Implement elevation through shadows and overlays\n- Use consistent color theming system\n- Support both Material Design 2 and 3 specifications\n- Ensure accessibility compliance (contrast ratios, touch targets)\n\n### WPF Theming Best Practices\n- Use `TemplateBinding` for connecting to parent properties\n- Implement proper focus visuals and keyboard navigation\n- Support high contrast mode and accessibility features\n- Use appropriate triggers for state changes (hover, pressed, disabled)\n- Leverage WPF's dependency property system effectively\n\n### Resource Organization\n- Brush resources: `MaterialDesign.Brush.*`\n- Style resources: Clear, descriptive names matching WPF conventions\n- Template resources: Match control types and variants\n- Color resources: Follow Material Design naming (Primary, Secondary, Surface, etc.)\n\n## API Design Guidelines\n\n- **Maintain backward compatibility** - This is a widely-used library\n- **Minimal public API surface** - Only expose what's necessary\n- **Consistent naming** - Follow WPF and Material Design conventions\n- **Proper documentation** - XML docs for all public APIs\n- **Designer support** - Ensure controls work well in Visual Studio designer\n\n## Common Tasks and Patterns\n\n### Adding a New Style\n1. Define in appropriate XAML resource dictionary\n2. Follow existing naming conventions\n3. Test in demo applications\n4. Ensure accessibility compliance\n5. Add to migration scripts if replacing existing styles\n\n### Theme Modifications\n1. Use `PaletteHelper` for runtime theme changes\n2. Support both static and dynamic resource binding\n3. Test with both Light and Dark themes\n4. Verify color adjustments work properly\n\n### Custom Control Development\n1. Only when no WPF equivalent exists\n2. Follow Material Design specifications exactly\n3. Implement proper template parts and visual states\n4. Support theming and color adjustments\n5. Include comprehensive tests and demo usage\n\nRemember: This library's primary goal is to provide a complete, high-quality Material Design theming solution for WPF applications while maintaining excellent performance and broad compatibility.","isInternal":false,"tokens":1860,"sizeBytes":8489}],"systemPromptSnippet":"<yakaai_skills repo=\"MaterialDesignInXAML/MaterialDesignInXamlToolkit\">\n<!-- File: .github/skills/mtp-test-running/SKILL.md (Tokens: ~744 | Category: anthropic-skill) -->\n---\nname: mtp-test-running\ndescription: Run MaterialDesignInXamlToolkit tests correctly with dotnet test, TUnit, and Microsoft Testing Platform. Use when validating changes, choosing a safe test scope, or filtering to the exact affected tests.\n---\n\n# Test running with MTP\n\nUse this skill when you need to run or suggest test commands in this repository.\n\n## Repository-specific runner setup\n\n1. Test projects use `UseMicrosoftTestingPlatformRunner=true`.\n2. Test projects also set `TestingPlatformDotnetTestSupport=true`.\n3. `global.json` does **not** opt into `test.runner = Microsoft.Testing.Platform`.\n4. That means this repo currently uses `dotnet test` in the legacy CLI mode while delegating execution to MTP-backed test applications.\n5. Runner-specific arguments must therefore be passed after an extra `--`.\n6. Do **not** rely on top-level `dotnet test --filter ...` for these projects.\n\n## Strong preferences\n\n1. Start with the smallest non-UI test scope that covers the change.\n2. Avoid `MaterialDesignThemes.UITests` unless the change is inherently runtime WPF behavior.\n3. Only run UI tests after the user explicitly asks or grants permission.\n4. When UI tests are necessary, run only the affected tests, never the whole UI suite.\n\n## TUnit filter syntax\n\nTUnit uses `--treenode-filter`.\n\nFormat:\n\n`/<Assembly>/<Namespace>/<Class>/<Test>`\n\n- Use `*` as a wildcard within a segment.\n- Use `(A)|(B)` inside a segment for OR.\n- Prefer exact class and test names over namespace-wide filters.\n- Add `--minimum-expected-tests <n>` so an empty selection fails loudly.\n\n## Command patterns\n\n### Example targeted non-UI test run\n\n```powershell\ndotnet test tests\\MaterialDesignThemes.Wpf.Tests\\MaterialDesignThemes.Wpf.Tests.csproj -c Release --no-build -- --treenode-filter \"/*/*/AutomationPropertiesNameConverterTests/*\" --minimum-expected-tests 1 --no-ansi --no-progress\n```\n\n### Example targeted UI validation\n\n```powershell\ndotnet test tests\\MaterialDesignThemes.UITests\\MaterialDesignThemes.UITests.csproj -c Release --no-build -- --treenode-filter \"/*/*/DecimalUpDownTests/(NumericButtons_WithMaximum_DisablesPlusButton)|(NumericButtons_WithMinimum_DisablesMinusButton)\" --minimum-expected-tests 2 --no-ansi --no-progress\n```\n\n### Verify a UI filter before running\n\n```powershell\ntests\\MaterialDesignThemes.UITests\\bin\\Release\\net10.0-windows\\MaterialDesignThemes.UITests.exe --list-tests --no-ansi --treenode-filter \"/*/*/DecimalUpDownTests/(NumericButtons_WithMaximum_DisablesPlusButton)|(NumericButtons_WithMinimum_DisablesMinusButton)\"\n```\n\n## Mistakes to avoid\n\n- Using top-level `dotnet test --filter ...` for these MTP-backed projects.\n- Passing runner-specific flags before the extra `--`.\n- Running broad UI suites when one or two targeted tests are enough.\n- Forgetting `--minimum-expected-tests`, which can hide a bad filter.\n\n## Useful references\n\n- `global.json`\n- `tests/MaterialDesignThemes.Wpf.Tests/MaterialDesignThemes.Wpf.Tests.csproj`\n- `tests/MaterialDesignThemes.UITests/MaterialDesignThemes.UITests.csproj`\n- https://learn.microsoft.com/dotnet/core/testing/unit-testing-with-dotnet-test\n- https://tunit.dev/docs/execution/test-filters\n\n<!-- File: .github/skills/xamltest-ui-tests/SKILL.md (Tokens: ~754 | Category: anthropic-skill) -->\n---\nname: xamltest-ui-tests\ndescription: Write and update WPF UI tests in MaterialDesignThemes.UITests using XAMLTest. Use when template, layout, focus, interaction, or visual behavior needs coverage, or when a reviewer asks to move runtime UI checks out of MaterialDesignThemes.Wpf.Tests.\n---\n\n# XAMLTest UI tests\n\nUse this skill when working on runtime WPF behavior in this repository.\n\n## When to use it\n\n- A change touches templates, visual states, focus behavior, layout, coordinates, or input handling.\n- You need to inspect named template parts such as `PART_TextBox` or `PART_IncreaseButton`.\n- A reviewer asks to use XAMLTest instead of regular unit tests.\n- You need to assert WPF-only properties like `Padding`, `Visibility`, `ActualWidth`, or `DataContext` state after layout.\n\n## Repository-specific rules\n\n1. Put runtime UI behavior tests in `tests/MaterialDesignThemes.UITests`.\n2. Do **not** add visual-tree or layout interaction tests to `tests/MaterialDesignThemes.Wpf.Tests`.\n3. Prefer extending the existing feature file under `tests/MaterialDesignThemes.UITests/WPF/<feature>/` instead of creating a generic catch-all test file.\n4. Match the existing file's result-recording pattern; many current UI tests use `TestRecorder`, but it should not be treated as a blanket requirement.\n5. Ask permission before running UI tests, and only run the affected ones.\n\n## Standard pattern\n\n1. Inherit from `TestBase`.\n2. Use `LoadXaml<T>()` for focused control scenarios.\n3. Use `LoadUserControl<T>()` when you need a sample view model, bindings, or additional focus targets.\n4. Get named parts with `GetElement<T>(\"PART_Name\")`.\n5. Use `RemoteExecute` with static methods for properties that helpers do not expose directly.\n6. Use `Wait.For(...)` for layout-sensitive assertions.\n\n## What to prefer\n\n- `GetCoordinates()` for alignment and spacing assertions.\n- `RemoteExecute` for `Padding`, `Visibility`, `ActualWidth`, `Margin`, or `DataContext` inspection.\n- Keyboard and mouse helpers such as `MoveKeyboardFocus`, `SendKeyboardInput`, and `LeftClick` for interaction.\n\n## What to avoid\n\n- Inspecting the visual tree from `MaterialDesignThemes.Wpf.Tests` for runtime template behavior.\n- Overly broad UI suites when a single targeted XAMLTest scenario will do.\n- Repeating helper code inline when a small static local or private helper method is enough.\n\n## Example\n\n```csharp\n[Test]\npublic async Task DecimalUpDown_WithMaximum_DisablesPlusButton()\n{\n    await using var recorder = new TestRecorder(App);\n\n    var decimalUpDown = await LoadXaml<DecimalUpDown>(\"\"\"\n    <materialDesign:DecimalUpDown Value=\"1\" Maximum=\"2\" />\n    \"\"\");\n    var plusButton = await decimalUpDown.GetElement<RepeatButton>(\"PART_IncreaseButton\");\n    var textBox = await decimalUpDown.GetElement<TextBox>(\"PART_TextBox\");\n\n    await plusButton.LeftClick();\n    await Wait.For(async () =>\n    {\n        await Assert.That(await textBox.GetText()).IsEqualTo(\"2\");\n        await Assert.That(await decimalUpDown.GetValue()).IsEqualTo(2);\n    });\n\n    await Assert.That(await plusButton.GetIsEnabled()).IsFalse();\n\n    recorder.Success();\n}\n```\n\n## Useful local references\n\n- `tests/MaterialDesignThemes.UITests/TestBase.cs`\n- `tests/MaterialDesignThemes.UITests/XamlTestExtensions.cs`\n- Existing feature tests under `tests/MaterialDesignThemes.UITests/WPF/`\n\n<!-- File: .github/copilot-instructions.md (Tokens: ~1860 | Category: copilot-instructions) -->\n# Copilot Instructions for MaterialDesignInXamlToolkit\n\n## Repository Overview\n\nThe MaterialDesignInXamlToolkit is a **theme library** for WPF applications that provides Material Design themes and styling. This is NOT a control library - the focus is on theming existing WPF controls and providing custom controls only when necessary to support Google's Material Design specifications.\n\n### Key Principles\n- Theme library, not control library\n- Styling existing WPF controls to match Material Design\n- Custom controls only for Google-specified components that don't exist in WPF\n- No application or business logic belongs in this library\n- Provide base tools and springboard for developers to create their own controls\n\n## Architecture and Structure\n\n### Core Projects\n- **`MaterialDesignThemes.Wpf`** - Main theming library with styles, templates, and controls\n- **`MaterialDesignColors.Wpf`** - Color palette and theme management\n- **`MaterialDesignThemes.MahApps`** - Integration with MahApps.Metro\n- **`MainDemo.Wpf`** - Primary demonstration application\n- **`MaterialDesign3.Demo.Wpf`** - Material Design 3 demonstration\n- **`MaterialDesignToolkit.ResourceGeneration`** - Build-time resource generation tools\n\n### Key Technologies\n- **WPF (Windows Presentation Foundation)** - UI framework\n- **XAML** - Markup for UI definitions and styles  \n- **Material Design** - Google's design system implementation\n- **.NET 8** and **.NET Framework 4.7.2** - Target frameworks for the library\n- **.NET 9 SDK** - Required for building (as specified in `global.json`)\n- **C# 12.0** - Programming language\n- **PowerShell** - Build automation scripts\n\n## Development Environment\n\n### Requirements\n- **Windows** - Required for WPF development and compilation\n- **.NET 9 SDK** - As specified in `global.json` (note: projects target .NET 8 and .NET Framework 4.7.2)\n- **Visual Studio 2022** or **Visual Studio Code** with C# extension\n- **PowerShell** - For build scripts\n\n### Build and Test\n```powershell\n# Restore dependencies\ndotnet restore MaterialDesignToolkit.Full.slnx\n\n# Build (requires Windows)\ndotnet build MaterialDesignToolkit.Full.slnx --configuration Release --no-restore -p:Platform=\"Any CPU\" -p:TreatWarningsAsErrors=True\n\n# Run tests\ndotnet test MaterialDesignToolkit.Full.slnx --configuration Release --no-build\n\n# Build NuGet packages\n.\\build\\BuildNugets.ps1 -MDIXVersion \"x.x.x\" -MDIXColorsVersion \"x.x.x\" -MDIXMahAppsVersion \"x.x.x\"\n```\n\n## Code Style and Conventions\n\n### General Guidelines\n- Follow standard Visual Studio settings with ReSharper suggestions\n- Use .editorconfig settings (4-space indents for C#, 2-space for XAML/XML)\n- Allman brace style (`csharp_new_line_before_open_brace = all`)\n- No `this.` qualification unless necessary\n- Prefer explicit types over `var` for built-in types\n- Use PascalCase for public members, interfaces start with `I`\n\n### C# Conventions\n```csharp\n// Preferred dependency property pattern\npublic static readonly DependencyProperty MyPropertyProperty =\n    DependencyProperty.Register(\"MyProperty\", typeof(string), typeof(MyControl), \n        new UIPropertyMetadata(\"DefaultValue\", OnMyPropertyChanged));\n\npublic string MyProperty\n{\n    get => (string)GetValue(MyPropertyProperty);\n    set => SetValue(MyPropertyProperty, value);\n}\n\nprivate static void OnMyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n{\n    var control = (MyControl)d;\n    // Handle property change\n}\n```\n\n### XAML Style Guidelines\n- Use XamlStyler settings from `Settings.XamlStyler`\n- 2-space indentation for XAML\n- Keep first attribute on same line as element\n- Order attributes according to defined groups\n- Use `{StaticResource}` over `{DynamicResource}` where possible\n- Follow resource naming: `MaterialDesign.Brush.Primary.Light`\n\n## WPF and Material Design Context\n\n### Theme Architecture\n- **Base Themes**: Light and Dark variants\n- **Color System**: Primary, Secondary, Surface, Background colors with variants\n- **Elevation**: Shadow and overlay systems for depth\n- **Typography**: Material Design text styles\n- **Motion**: Transitions and animations\n\n### Common Patterns\n```csharp\n// Theme modification pattern\nprivate static void ModifyTheme(Action<Theme> modificationAction)\n{\n    var paletteHelper = new PaletteHelper();\n    Theme theme = paletteHelper.GetTheme();\n    \n    modificationAction?.Invoke(theme);\n    \n    paletteHelper.SetTheme(theme);\n}\n\n// Color adjustment usage\ntheme.ColorAdjustment = new ColorAdjustment\n{\n    DesiredContrastRatio = desiredRatio,\n    Contrast = contrastValue,\n    Colors = colorSelection\n};\n```\n\n### Resource Dictionary Patterns\n```xml\n<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                    xmlns:materialDesign=\"http://materialdesigninxaml.net/winfx/xaml/themes\">\n  \n  <ResourceDictionary.MergedDictionaries>\n    <materialDesign:BundledTheme BaseTheme=\"Light\" PrimaryColor=\"DeepPurple\" SecondaryColor=\"Lime\" />\n    <ResourceDictionary Source=\"pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/Generic.xaml\" />\n  </ResourceDictionary.MergedDictionaries>\n\n</ResourceDictionary>\n```\n\n## Testing Approach\n\n### Test Structure\n- **Unit Tests**: `MaterialDesignThemes.Wpf.Tests`, `MaterialDesignColors.Wpf.Tests`\n- **UI Tests**: `MaterialDesignThemes.UITests` - Visual/integration testing\n- **Demo Applications**: Manual testing and showcasing functionality\n\n### Test Patterns\n```csharp\n[Test]\npublic async Task ThemeTest_Example()\n{\n    await App.InitializeWithMaterialDesign(\n        baseTheme: BaseTheme.Light,\n        primary: PrimaryColor.Blue,\n        secondary: SecondaryColor.Orange);\n        \n    // Test implementation\n}\n```\n\n## Build Pipeline and Automation\n\n### GitHub Actions Workflows\n- **PR Verification**: `pr_verification.yml` - Build and test on PRs\n- **Build Artifacts**: `build_artifacts.yml` - Main build pipeline\n- **Release**: `release.yml` - Create releases and publish NuGets\n\n### PowerShell Build Scripts\n- **`BuildNugets.ps1`** - Package creation\n- **`ApplyXamlStyler.ps1`** - Code formatting\n- **`MigrateBrushes.ps1`** - Resource migration utilities\n- **`UpdateNugets.ps1`** - Package management\n\n## Domain-Specific Knowledge\n\n### Material Design Implementation\n- Follow Google Material Design guidelines strictly\n- Implement elevation through shadows and overlays\n- Use consistent color theming system\n- Support both Material Design 2 and 3 specifications\n- Ensure accessibility compliance (contrast ratios, touch targets)\n\n### WPF Theming Best Practices\n- Use `TemplateBinding` for connecting to parent properties\n- Implement proper focus visuals and keyboard navigation\n- Support high contrast mode and accessibility features\n- Use appropriate triggers for state changes (hover, pressed, disabled)\n- Leverage WPF's dependency property system effectively\n\n### Resource Organization\n- Brush resources: `MaterialDesign.Brush.*`\n- Style resources: Clear, descriptive names matching WPF conventions\n- Template resources: Match control types and variants\n- Color resources: Follow Material Design naming (Primary, Secondary, Surface, etc.)\n\n## API Design Guidelines\n\n- **Maintain backward compatibility** - This is a widely-used library\n- **Minimal public API surface** - Only expose what's necessary\n- **Consistent naming** - Follow WPF and Material Design conventions\n- **Proper documentation** - XML docs for all public APIs\n- **Designer support** - Ensure controls work well in Visual Studio designer\n\n## Common Tasks and Patterns\n\n### Adding a New Style\n1. Define in appropriate XAML resource dictionary\n2. Follow existing naming conventions\n3. Test in demo applications\n4. Ensure accessibility compliance\n5. Add to migration scripts if replacing existing styles\n\n### Theme Modifications\n1. Use `PaletteHelper` for runtime theme changes\n2. Support both static and dynamic resource binding\n3. Test with both Light and Dark themes\n4. Verify color adjustments work properly\n\n### Custom Control Development\n1. Only when no WPF equivalent exists\n2. Follow Material Design specifications exactly\n3. Implement proper template parts and visual states\n4. Support theming and color adjustments\n5. Include comprehensive tests and demo usage\n\nRemember: This library's primary goal is to provide a complete, high-quality Material Design theming solution for WPF applications while maintaining excellent performance and broad compatibility.\n</yakaai_skills>"}