Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TokenComboBoxStyleSettings.TokenBorderTemplate Property

Gets or sets the ControlTemplate used to render the border and background area of a token. This is a dependency property.

Namespace: DevExpress.Xpf.Editors

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

NuGet Package: DevExpress.Wpf.Core

#Declaration

public ControlTemplate TokenBorderTemplate { get; set; }

#Property Value

Type Description
ControlTemplate

A ControlTemplate object that specifies the visual structure of the token’s border and background area.

#Remarks

The TokenBorderTemplate property allows you to customize the token’s border representation by using templates.

The code sample below demonstrates how to display a custom border around the tokens and alter the token’s background color.

<dxe:ComboBoxEdit ItemsSource="{Binding Customers}">
   <dxe:ComboBoxEdit.StyleSettings>
      <dxe:TokenComboBoxStyleSettings>
         <dxe:TokenComboBoxStyleSettings.TokenBorderTemplate>
            <ControlTemplate TargetType="{x:Type ContentControl}">
               <Border BorderThickness="3" BorderBrush="Red" 
                       Background="WhiteSmoke" CornerRadius="4">
                  <ContentPresenter/>
               </Border>
            </ControlTemplate>
         </dxe:TokenComboBoxStyleSettings.TokenBorderTemplate>
      </dxe:TokenComboBoxStyleSettings>
   </dxe:ComboBoxEdit.StyleSettings>
</dxe:ComboBoxEdit>
See Also