Skip to main content
.NETFramework4.7.2net8.0-windows7.0

Automatically implements WPF dependency properties from a C# automatic property and WPF commands from a C# method thanks to Metalama.

Published
Jul 21, 2026
2mo ago
Total Downloads
21.3K
21,286

Install

dotnet add package Metalama.Patterns.Wpf --version 2026.1.21
ProductVersions
.NET
net8.0-windows7.0
Other
.NETFramework4.7.2

README

Metalama by PostSharp

About

The Metalama.Patterns.Wpf contains aspects that implement WPF dependency properties and commands.

Key Features

  • Generates WPF dependency properties from C# automatic properties:
  • Integrates with Metalama.Patterns.Contracts.
  • Supports custom property-changing and property-changed methods.
  • Turns property initializer values into default values.
  • Generates WPF commands from C# methods:
    • Supports a CanExecute method or property.
    • Integrates with Metalama.Patterns.Observability to support INotifyPropertyChanged.
  • Supports custom naming conventions.

Main Types

The primary types in this package are:

  • DependencyPropertyAttribute is an aspect that generates a WPF dependency property from a plain automatic property.
  • CommandAttribute is an aspect that generates a WPF command property from a plain C# method.
  • DependencyPropertyExtensions.ConfigureDependencyProperty is a fabric extension method that configures the DependencyPropertyAttribute aspect.
  • CommandExtensions.ConfigureCommand is a fabric extension method that configures the CommandAttribute aspect.

Additional Documentation

Related Packages

  • Metalama.Patterns.Contracts provides contract attributes such as [NotNull] or [Url]. They integrate with the DependencyPropertyAttribute aspect.
  • Metalama.Patterns.Observability can implement INotifyPropertyChanged for the CanExecute property supported by the CommandAttribute aspect.

Changes from Previous Version

No structural changes between v2026.1.20 and v2026.1.21.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

Compatibility metadata lists 2 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.