Skip to main content
Bar

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

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.v24.2.dll

NuGet Package: DevExpress.Wpf.Core

#Declaration

public BarItemAutoSizeMode AutoSizeMode { get; set; }

#Property Value

Type Description
BarItemAutoSizeMode

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

Available values:

Name Description
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.

See Also