Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
55579e1
added AP to be able to swap between a scrollable and a wrapping heade…
corvinsz Jun 17, 2025
4733a54
Evaluate TextBox.LineCount only once in UpdateAttachedProperties (#3874)
greuelpirat Jun 18, 2025
122a534
added ToolTip demo page with a RichToolTip example. Applied new synta…
corvinsz Jun 19, 2025
bbdee06
fix when the TreeListView expands too much content, scrolling to the …
MohammadHadi2031 Jun 26, 2025
f31fe78
Updating tests to use TUnit and MTP (#3838)
Keboo Jun 27, 2025
b110061
Fix Enhance Mouseover Visuals for TabControl (#3803)
corvinsz Jun 27, 2025
fad77d5
Exposes BindableIsItemsHost attached property. (#3878)
Keboo Jun 27, 2025
4de685b
Bumping version to test nuget deployment
Keboo Jul 14, 2025
504d2c9
Embeds icon into NuGet packages (#3900)
Keboo Aug 20, 2025
d5c7d2f
Bump actions/checkout from 4 to 5 (#3898)
dependabot[bot] Aug 20, 2025
9e966e4
Invalidates visual after dialog opens (#3882)
Keboo Aug 20, 2025
ab615fe
Applying fix for binding error (#3881)
Keboo Aug 20, 2025
3e0f779
Bump actions/download-artifact from 4 to 5 (#3896)
dependabot[bot] Aug 20, 2025
8e6bfd6
Fix nuspec file (#3901)
Keboo Aug 20, 2025
471110f
Revert "Used x:Reference in Button and ProgressBar ControlTemplates (…
JorisCleVR Aug 22, 2025
e6a002a
✨ Set up Copilot instructions for MaterialDesignInXamlToolkit (#3910)
Copilot Aug 30, 2025
b655e99
Update packaging to use dotnet pack with centralized MSBuild properti…
Copilot Aug 31, 2025
ceea98f
Fixes NuGet package creation output path (#3911)
Keboo Aug 31, 2025
8da4640
Fix: Add TemplateBindings to CornerRadius, BorderBrush and BorderThic…
HedpE- Sep 3, 2025
44ae0e3
Default AutomationProperties.Name to HintAssist.Hint (#3913)
corvinsz Sep 5, 2025
a0517e7
Bump actions/stale from 9 to 10 (#3916)
dependabot[bot] Sep 8, 2025
46e5193
Bump actions/setup-dotnet from 4 to 5 (#3917)
dependabot[bot] Sep 8, 2025
be0b22b
Update README to remove example links
Keboo Sep 11, 2025
49b362a
Add hover halo for `CheckBox` and `RadioButton` (#3919)
corvinsz Sep 15, 2025
aa2bddd
Set SmartHint.IsContentNullOrEmpty on initial load (#3915)
corvinsz Sep 15, 2025
486d73a
implement TreeDataGrid (#3877)
MohammadHadi2031 Sep 26, 2025
e5d0c3d
Prefer TemplateBinding over Binding with RelativeSource (#3930)
corvinsz Sep 27, 2025
bdde277
Fix White rectangle when disabling Calendar (#3935)
corvinsz Oct 4, 2025
c26fcc5
Fix horizontal ScrollBar placement for multi-line TextBox (#3934)
nicolaihenriksen Oct 4, 2025
acfa2df
Updates versions to 5.3.1 (#3941)
Keboo Oct 6, 2025
e8b61ec
Bump fastify/github-action-merge-dependabot from 3.11.1 to 3.11.2 (#3…
dependabot[bot] Oct 10, 2025
8304e64
Porting material-color-utilities to dotnet #2475 (#3920)
MovGP0 Oct 10, 2025
65c1d80
✨ Set up comprehensive Copilot instructions with clarified .NET versi…
Copilot Oct 11, 2025
2ba6a98
Update MaterialDesignPopupBoxButton style properties (#3936)
corvinsz Oct 17, 2025
6d12a66
rebase on master
corvinsz Jun 17, 2025
e326f7c
Refactor TabControl templates so that `ScrollingTabControlTemplate` a…
corvinsz Oct 24, 2025
3de88e2
Split ScrollingTabControlTemplate and WrappingTabControlTemplate into…
corvinsz Oct 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
225 changes: 225 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
# Copilot Instructions for MaterialDesignInXamlToolkit

## Repository Overview

The 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.

### Key Principles
- Theme library, not control library
- Styling existing WPF controls to match Material Design
- Custom controls only for Google-specified components that don't exist in WPF
- No application or business logic belongs in this library
- Provide base tools and springboard for developers to create their own controls

## Architecture and Structure

### Core Projects
- **`MaterialDesignThemes.Wpf`** - Main theming library with styles, templates, and controls
- **`MaterialDesignColors.Wpf`** - Color palette and theme management
- **`MaterialDesignThemes.MahApps`** - Integration with MahApps.Metro
- **`MainDemo.Wpf`** - Primary demonstration application
- **`MaterialDesign3.Demo.Wpf`** - Material Design 3 demonstration
- **`MaterialDesignToolkit.ResourceGeneration`** - Build-time resource generation tools

### Key Technologies
- **WPF (Windows Presentation Foundation)** - UI framework
- **XAML** - Markup for UI definitions and styles
- **Material Design** - Google's design system implementation
- **.NET 8** and **.NET Framework 4.7.2** - Target frameworks for the library
- **.NET 9 SDK** - Required for building (as specified in `global.json`)
- **C# 12.0** - Programming language
- **PowerShell** - Build automation scripts

## Development Environment

### Requirements
- **Windows** - Required for WPF development and compilation
- **.NET 9 SDK** - As specified in `global.json` (note: projects target .NET 8 and .NET Framework 4.7.2)
- **Visual Studio 2022** or **Visual Studio Code** with C# extension
- **PowerShell** - For build scripts

### Build and Test
```powershell
# Restore dependencies
dotnet restore MaterialDesignToolkit.Full.sln

# Build (requires Windows)
dotnet build MaterialDesignToolkit.Full.sln --configuration Release --no-restore -p:Platform="Any CPU" -p:TreatWarningsAsErrors=True

# Run tests
dotnet test MaterialDesignToolkit.Full.sln --configuration Release --no-build

# Build NuGet packages
.\build\BuildNugets.ps1 -MDIXVersion "x.x.x" -MDIXColorsVersion "x.x.x" -MDIXMahAppsVersion "x.x.x"
```

## Code Style and Conventions

### General Guidelines
- Follow standard Visual Studio settings with ReSharper suggestions
- Use .editorconfig settings (4-space indents for C#, 2-space for XAML/XML)
- Allman brace style (`csharp_new_line_before_open_brace = all`)
- No `this.` qualification unless necessary
- Prefer explicit types over `var` for built-in types
- Use PascalCase for public members, interfaces start with `I`

### C# Conventions
```csharp
// Preferred dependency property pattern
public static readonly DependencyProperty MyPropertyProperty =
DependencyProperty.Register("MyProperty", typeof(string), typeof(MyControl),
new UIPropertyMetadata("DefaultValue", OnMyPropertyChanged));

public string MyProperty
{
get => (string)GetValue(MyPropertyProperty);
set => SetValue(MyPropertyProperty, value);
}

private static void OnMyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var control = (MyControl)d;
// Handle property change
}
```

### XAML Style Guidelines
- Use XamlStyler settings from `Settings.XamlStyler`
- 2-space indentation for XAML
- Keep first attribute on same line as element
- Order attributes according to defined groups
- Use `{StaticResource}` over `{DynamicResource}` where possible
- Follow resource naming: `MaterialDesign.Brush.Primary.Light`

## WPF and Material Design Context

### Theme Architecture
- **Base Themes**: Light and Dark variants
- **Color System**: Primary, Secondary, Surface, Background colors with variants
- **Elevation**: Shadow and overlay systems for depth
- **Typography**: Material Design text styles
- **Motion**: Transitions and animations

### Common Patterns
```csharp
// Theme modification pattern
private static void ModifyTheme(Action<Theme> modificationAction)
{
var paletteHelper = new PaletteHelper();
Theme theme = paletteHelper.GetTheme();

modificationAction?.Invoke(theme);

paletteHelper.SetTheme(theme);
}

// Color adjustment usage
theme.ColorAdjustment = new ColorAdjustment
{
DesiredContrastRatio = desiredRatio,
Contrast = contrastValue,
Colors = colorSelection
};
```

### Resource Dictionary Patterns
```xml
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes">

<ResourceDictionary.MergedDictionaries>
<materialDesign:BundledTheme BaseTheme="Light" PrimaryColor="DeepPurple" SecondaryColor="Lime" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/Generic.xaml" />
</ResourceDictionary.MergedDictionaries>

</ResourceDictionary>
```

## Testing Approach

### Test Structure
- **Unit Tests**: `MaterialDesignThemes.Wpf.Tests`, `MaterialDesignColors.Wpf.Tests`
- **UI Tests**: `MaterialDesignThemes.UITests` - Visual/integration testing
- **Demo Applications**: Manual testing and showcasing functionality

### Test Patterns
```csharp
[Test]
public async Task ThemeTest_Example()
{
await App.InitializeWithMaterialDesign(
baseTheme: BaseTheme.Light,
primary: PrimaryColor.Blue,
secondary: SecondaryColor.Orange);

// Test implementation
}
```

## Build Pipeline and Automation

### GitHub Actions Workflows
- **PR Verification**: `pr_verification.yml` - Build and test on PRs
- **Build Artifacts**: `build_artifacts.yml` - Main build pipeline
- **Release**: `release.yml` - Create releases and publish NuGets

### PowerShell Build Scripts
- **`BuildNugets.ps1`** - Package creation
- **`ApplyXamlStyler.ps1`** - Code formatting
- **`MigrateBrushes.ps1`** - Resource migration utilities
- **`UpdateNugets.ps1`** - Package management

## Domain-Specific Knowledge

### Material Design Implementation
- Follow Google Material Design guidelines strictly
- Implement elevation through shadows and overlays
- Use consistent color theming system
- Support both Material Design 2 and 3 specifications
- Ensure accessibility compliance (contrast ratios, touch targets)

### WPF Theming Best Practices
- Use `TemplateBinding` for connecting to parent properties
- Implement proper focus visuals and keyboard navigation
- Support high contrast mode and accessibility features
- Use appropriate triggers for state changes (hover, pressed, disabled)
- Leverage WPF's dependency property system effectively

### Resource Organization
- Brush resources: `MaterialDesign.Brush.*`
- Style resources: Clear, descriptive names matching WPF conventions
- Template resources: Match control types and variants
- Color resources: Follow Material Design naming (Primary, Secondary, Surface, etc.)

## API Design Guidelines

- **Maintain backward compatibility** - This is a widely-used library
- **Minimal public API surface** - Only expose what's necessary
- **Consistent naming** - Follow WPF and Material Design conventions
- **Proper documentation** - XML docs for all public APIs
- **Designer support** - Ensure controls work well in Visual Studio designer

## Common Tasks and Patterns

### Adding a New Style
1. Define in appropriate XAML resource dictionary
2. Follow existing naming conventions
3. Test in demo applications
4. Ensure accessibility compliance
5. Add to migration scripts if replacing existing styles

### Theme Modifications
1. Use `PaletteHelper` for runtime theme changes
2. Support both static and dynamic resource binding
3. Test with both Light and Dark themes
4. Verify color adjustments work properly

### Custom Control Development
1. Only when no WPF equivalent exists
2. Follow Material Design specifications exactly
3. Implement proper template parts and visual states
4. Support theming and color adjustments
5. Include comprehensive tests and demo usage

Remember: 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.
6 changes: 3 additions & 3 deletions .github/workflows/build_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
solution: MaterialDesignToolkit.Full.sln

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Setup .NET
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.x
Expand All @@ -54,7 +54,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: Screenshots-${{ github.run_number }}
path: ${{ github.workspace }}tests\MaterialDesignThemes.UITests\bin\${{ inputs.build-configuration }}\net8.0-windows7\Screenshots
path: ${{ github.workspace }}\tests\MaterialDesignThemes.UITests\bin\${{ inputs.build-configuration }}\net9.0-windows\Screenshots
if-no-files-found: ignore

- name: Build NuGets
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/control_styles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Generate Control Styles Markdown
run: build/GenerateThemesWikiMarkdown.ps1
shell: pwsh
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/get_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
getting_versions:
env:
#Update these base version numbers
mdix-version: "5.2.2"
mdix-colors-version: "5.2.2"
mdix-mahapps-version: "5.2.2"
mdix-version: "5.3.1"
mdix-colors-version: "5.3.1"
mdix-mahapps-version: "5.3.1"
name: Set version numbers
runs-on: ubuntu-latest
defaults:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/icon_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Run Icon Generation
run: dotnet run -c Release -- icons
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:

steps:
- name: Download NuGet Artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: NuGets
path: nugets
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
contents: write

steps:
- uses: fastify/[email protected].1
- uses: fastify/[email protected].2
22 changes: 12 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ jobs:
name: Get Icon Changes

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Download NuGet Artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: NuGets
path: nugets
Expand Down Expand Up @@ -124,13 +124,13 @@ jobs:

steps:
- name: Download NuGet Artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: NuGets
path: nugets

- name: Download Demo App Artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: DemoApp
path: demo-app
Expand All @@ -139,7 +139,7 @@ jobs:
run: zip -r DemoApp.zip demo-app/*

- name: Download Release Notes
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: ReleaseNotes

Expand All @@ -156,12 +156,12 @@ jobs:

steps:
- name: Checkout Wiki Repo
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: ${{ github.repository }}.wiki

- name: Download Icon Changes
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: IconChanges
path: icon-changes
Expand Down Expand Up @@ -224,7 +224,7 @@ jobs:

steps:
- name: Download NuGet Artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: NuGets
path: nugets
Expand Down Expand Up @@ -254,7 +254,7 @@ jobs:
# Doing a checkout, until this issue is resolved.
# https://github.com/valeriobelli/gh-milestone/issues/15
# As of version 2.1.0 the -R doesn't appear to output valid json when filtering. So still using the checkout.
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Close Milestone
run: |
Expand All @@ -274,7 +274,7 @@ jobs:

steps:
# Checkout is needed so that we can update the get_versions.yml file
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Increment Version Numbers
run: |
Expand Down Expand Up @@ -305,6 +305,8 @@ jobs:
Update-Version -Prefix "mdix-mahapps-version"

- name: Open Pull Request
env:
GH_TOKEN: ${{ secrets.SA_PAT }}
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale_issues_and_prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
- uses: actions/stale@v10
with:
stale-issue-message: 'This issue is marked stale because it has been open 30 days with no activity. Remove stale label or update the issue, otherwise it will be closed in 14 days.'
stale-pr-message: 'This PR is marked stale because it has been open 60 days with no activity. Remove stale label or update the PR, otherwise it will be closed in 14 days.'
Expand Down
Loading
Loading