wpf-devexpress-dot-xpf-dot-navbar-dot-navbarcontrol-ed67ee63.md
Gets or sets the data source that is used to generate the content of the NavBar control.
Namespace : DevExpress.Xpf.NavBar
Assembly : DevExpress.Xpf.NavBar.v25.2.dll
NuGet Package : DevExpress.Wpf.NavBar
public IEnumerable ItemsSource { get; set; }
Public Property ItemsSource As IEnumerable
| Type | Description |
|---|---|
| IEnumerable |
A data source object that implements the IEnumerable interface.
|
Use the ItemsSource property to populate the NavBar control with groups and items taken from the specified data source. When the NavBar control is bound to a data source, data source items are represented by NavBar items organized in groups, dependent on the NavBarControl.GroupDescription property setting.
If the NavBar is bound to a data source, its NavBarControl.Groups and NavBarGroup.Items collections are populated implicitly, have a fixed size and cannot be explicitly modified.
During data binding of a NavBar element (a group or item), the corresponding event (NavBarViewBase.GroupAdding or NavBarViewBase.ItemAdding) is generated, allowing you to access the created element’s data source item (see the event argument’s ElementAddingEventArgs.SourceObject property).
The following code snippets (auto-collected from DevExpress Examples) contain references to the ItemsSource 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.
<Label Content="Double-click the action name on the left to run the example" FontSize="18" Grid.ColumnSpan="2" Grid.Row="0"/>
<dxn:NavBarControl Name="navBarControl1" Grid.Column="0" Grid.Row="1" ItemsSource="{Binding}" >
<dxn:NavBarControl.View>
wpf-spreadsheetcontrol-api-part-1/CS/SpreadsheetControl_WPF_API/MainWindow.xaml#L37
<Label Content="Double-click the action on the left to run the example" FontSize="18" Grid.ColumnSpan="2" Grid.Row="0" Padding="5" />
<dxn:NavBarControl Name="navBarControl1" Grid.Column="0" Grid.Row="1" ItemsSource="{Binding}">
<dxn:NavBarControl.View>
wpf-spreadsheetcontrol-api-part-2/CS/SpreadsheetControl_WPF_API_Part02/MainWindow.xaml#L36
<Label Content="Double-click the action name on the left to run the example" FontSize="18" Grid.ColumnSpan="2" Grid.Row="0" />
<dxn:NavBarControl Name="navBarControl1" Grid.Column="0" Grid.Row="1" ItemsSource="{Binding}">
<dxn:NavBarControl.View>
See Also