Back to Devexpress

ButtonEdit.ButtonTemplateSelector Property

wpf-devexpress-dot-xpf-dot-editors-dot-buttonedit-0642d896.md

latest2.3 KB
Original Source

ButtonEdit.ButtonTemplateSelector Property

Gets or sets the template selector that provides a way to select a particular data template used to render buttons of the current ButtonEdit.

Namespace : DevExpress.Xpf.Editors

Assembly : DevExpress.Xpf.Core.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public DataTemplateSelector ButtonTemplateSelector { get; set; }
vb
Public Property ButtonTemplateSelector As DataTemplateSelector

Property Value

TypeDescription
DataTemplateSelector

A DataTemplateSelector descendant that provides the way to select a particular data template used to render buttons of the current ButtonEdit.

|

Remarks

The ButtonTemplateSelector property supports the MVVM design pattern. The ButtonEdit.ButtonsSource property specifies the collection of buttons that are rendered using templates. You can declare several data templates and apply one of them to render the buttons, based on your own logic. To implement this approach, first create the System.Windows.Controls.DataTemplateSelector descendant and override the DataTemplateSelector.SelectTemplate method to realize the template selection logic. Then, assign an instance of this object to the ButtonTemplateSelector property and declare your data templates. The data templates can be defined in a resource dictionary.

See Also

ButtonsSource

ButtonTemplate

MVVM Framework

ButtonEdit Class

ButtonEdit Members

DevExpress.Xpf.Editors Namespace