Back to Devexpress

BaseLayoutItem.CaptionFormat Property

wpf-devexpress-dot-xpf-dot-docking-dot-baselayoutitem-62156a10.md

latest1.9 KB
Original Source

BaseLayoutItem.CaptionFormat Property

Gets or sets the format string used to format the layout item’s caption. This is a dependency property.

Namespace : DevExpress.Xpf.Docking

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

NuGet Package : DevExpress.Wpf.Docking

Declaration

csharp
public string CaptionFormat { get; set; }
vb
Public Property CaptionFormat As String

Property Value

TypeDescription
String

A string that specifies the caption format.

|

Remarks

The format specified by the CaptionFormat property must follow the Composite Formatting rules. Typically, the format string contains the “{0}” string plus custom text. The “{0}” string is a placeholder for the item’s caption, specified by the BaseLayoutItem.Caption property. To learn more about formatting, see Composite Formatting in MSDN.

The following code shows how to create a format string that adds a colon after an item’s caption:

xaml
<dxdo:LayoutControlItem x:Name="myLayoutItem" CaptionFormat="{}{0}:" Caption="Name">
...
</dxdo:LayoutControlItem>
csharp
myLayoutItem.CaptionFormat = "{0}:";

See Also

Caption

BaseLayoutItem Class

BaseLayoutItem Members

DevExpress.Xpf.Docking Namespace