[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
 [Expand]What's Installed
 [Expand].NET Core 3 Support
 [Collapse]Common Concepts
  [Expand]Printing and Exporting
  [Expand]Saving and Restoring Layouts
   Typed Styles
  [Expand]Touch Support
  [Expand]Formatting Values
   Prism Adapters
  [Expand]Data Sources
  [Expand]Performance Improvement
   XAML Namespaces
 [Expand]MVVM Framework
 [Expand]Controls and Libraries
 [Expand]Scaffolding Wizard
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Typed Styles

The typed style allows you to define element style in a simplified manner.

Starting with v.17.2, the DevExpress WPF subscription provides the DevExpress.Xpf.TypedStyles assembly that contains typed styles for the following controls:

  • for controls from base WPF assemblies (WindowsBase, PresentationCore, PresentationFramework);
  • DevExpress WPF controls.

This topic consists of the following sections:

Expanded Typed Styles vs. Regular Styles

The image below demonstrates the difference between the regular style and typed style.

To set a regular style for multiple buttons, you should implement a Style with TargetType=Button and specify each property in a separate Setter.

The typed styles allow you to define a style for all the buttons in the following way:

  • Create a new resource with a name like {ElementName}Style, where {ElementName} is a target type.

    Example: ButtonStyle for the standard Button control, GridControlStyle for the DevExpress GridControl.

  • Define the property values directly without setters. Define the typed style's x:Name property.
  • Assign the typed style to control the same way you assign regular styles.

Expanded Supported features

Typed styles support all the regular style features.

Attached properties

Attached properties are collected in MergedStyles property:


You can specify event handlers without EventSetters:

Markup Extensions

Markup extensions that return their value immediately (all except BindingBase and DynamicResoureExtension) can be used in typed styles in a regular way:

Use the "*_Source" properties for the BindingBase and DynamicResourceExtension markup extensions:

DevExpress Extensions (DXBinding/DXEvent/DXCommand)

DXBinding/DXCommand work seamlessly with typed styles.


DXEvent does not work with typed styles.

Base styles

You can define base styles in the following manner:


You can use regular setters by populating the *Style.Setters collection.

Implicit styles

To define implicit styles, use x:Key instead of TargetType:

The target type is set to typed style internally, so you should not set it manually. For example, to define the VirtualizingPanelStyle for ListBox, you need to define the ListBoxStyle first.


In addition to typed styles, the DevExpress.Xpf.TypedStyles assembly contains typed triggers for each supported control:

You can use typed triggers in templates. To do this, specify the typed trigger's SourceName or TemplateName property:

If you create triggers for multiple source objects, you can define multiple triggers:

Data triggers

Use TypedDataTrigger to use typed styles with data triggers.

Expanded Using in your code

References and namespaces

All the typed styles and triggers are implemented in the {Corresponding control namespace}.TypedStyles namespaces.

Example: ButtonStyle - System.Windows.Controls.TypedStyles.

The typed styles' XAML namespaces are the same as the corresponding controls' namespaces, so you do not need to add any additional namespace references. To use the typed styles, you need reference the DevExpress.Xpf.TypedStyles assembly in your project.



Visual Studio and Blend do not support typed styles. We recommend using typed styles when you edit XAML manually.


Typed styles have comparable performance to regular styles.

The following regular styles are applied for 200 ms on a testing machine:

The following analog implemented via typed styles is applied for 130 ms on a testing machine:

Is this topic helpful?​​​​​​​