Back to Devexpress

BarStaticItem.AutoSizeMode Property

wpf-devexpress-dot-xpf-dot-bars-dot-barstaticitem-54a73079.md

latest3.1 KB
Original Source

BarStaticItem.AutoSizeMode Property

Gets or sets the item’s auto-size mode. This is a dependency property.

Namespace : DevExpress.Xpf.Bars

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

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public BarItemAutoSizeMode AutoSizeMode { get; set; }
vb
Public Property AutoSizeMode As BarItemAutoSizeMode

Property Value

TypeDescription
BarItemAutoSizeMode

A BarItemAutoSizeMode value that specifies the item’s auto-size mode.

|

Available values:

NameDescription
None

Doesn’t apply the auto-size feature for a bar item link. The item link’s width is specified by the BarStaticItem.ItemWidth property.

| | Content |

Resizes a BarStaticItem’s link, so its width matches that link’s contents width.

| | Fill |

Resizes a specific BarStaticItem’s link so that it consumes the largest possible area of a bar.

To allow the bar to be stretched to the bar container’s width, set the Bar.UseWholeRow property to true.

|

Remarks

If the AutoSizeMode property is set to BarItemAutoSizeMode.Fill, the item’s link occupies the largest possible space within the bar. This setting makes sense when the bar is stretched to the bar container’s width (the Bar.UseWholeRow option is enabled).

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the AutoSizeMode property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-create-a-ribboncontrol/CS/RibbonControl_Ex/MainWindow.xaml#L265

xml
<dxr:RibbonStatusBarControl.RightItems>
    <dxb:BarStaticItem Name="bFileName" ItemMinWidth="150" AutoSizeMode="Fill" Content="Binding"/>
</dxr:RibbonStatusBarControl.RightItems>

See Also

UseWholeRow

ItemWidth

BarStaticItem Class

BarStaticItem Members

DevExpress.Xpf.Bars Namespace