wpf-devexpress-dot-xpf-dot-navbar-dot-navbaritem-ac815df4.md
Gets or sets the item’s content. This is a dependency property.
Namespace : DevExpress.Xpf.NavBar
Assembly : DevExpress.Xpf.NavBar.v25.2.dll
NuGet Package : DevExpress.Wpf.NavBar
public object Content { get; set; }
Public Property Content As Object
| Type | Description |
|---|---|
| Object |
An object specifying the item’s content.
|
Use the Content property to define the content of the item.
Note
The Content property is, by design, specified as the default property and the content property of an item. This, for example, allows you to declare item contents in XAML directly after an item declaration, without wrapping them into opening and closing NavBarItem.Content tags.
See the Item Content Model topic to learn more.
The following code snippets (auto-collected from DevExpress Examples) contain references to the Content 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.
<Style TargetType="dxn:NavBarItem">
<Setter Property="Content" Value="{Binding}"/>
<Setter Property="Template">
{
SpreadsheetExample example = item.Content as SpreadsheetExample;
if (example != null)
wpf-spreadsheetcontrol-api-part-1/CS/SpreadsheetControl_WPF_API/MainWindow.xaml.cs#L43
if (item == null) return;
SpreadsheetExample example = item.Content as SpreadsheetExample;
if (example == null) return;
wpf-spreadsheetcontrol-api-part-2/CS/SpreadsheetControl_WPF_API_Part02/MainWindow.xaml.cs#L33
{
SpreadsheetExample example = item.Content as SpreadsheetExample;
if (example != null)
If item IsNot Nothing Then
Dim example As SpreadsheetExample = TryCast(item.Content, SpreadsheetExample)
If example IsNot Nothing Then
wpf-spreadsheetcontrol-api-part-1/VB/SpreadsheetControl_WPF_API/MainWindow.xaml.vb#L43
End If
Dim example As SpreadsheetExample = TryCast(item.Content, SpreadsheetExample)
If example Is Nothing Then
wpf-spreadsheetcontrol-api-part-2/VB/SpreadsheetControl_WPF_API_Part02/MainWindow.xaml.vb#L30
If item IsNot Nothing Then
Dim example As SpreadsheetExample = TryCast(item.Content, SpreadsheetExample)
If example IsNot Nothing Then
See Also