Back to Devexpress

NavBarItem.Content Property

wpf-devexpress-dot-xpf-dot-navbar-dot-navbaritem-ac815df4.md

latest5.1 KB
Original Source

NavBarItem.Content Property

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

Declaration

csharp
public object Content { get; set; }
vb
Public Property Content As Object

Property Value

TypeDescription
Object

An object specifying the item’s content.

|

Remarks

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.

wpf-spreadsheet-how-to-apply-conditional-formatting-to-a-range-of-cells/CS/ConditionalFormatting_WPF_Examples/MainWindow.xaml#L18

xml
<Style TargetType="dxn:NavBarItem">
    <Setter Property="Content" Value="{Binding}"/>
    <Setter Property="Template">

wpf-spreadsheet-how-to-apply-conditional-formatting-to-a-range-of-cells/CS/ConditionalFormatting_WPF_Examples/MainWindow.xaml.cs#L43

csharp
{
    SpreadsheetExample example = item.Content as SpreadsheetExample;
    if (example != null)

wpf-spreadsheetcontrol-api-part-1/CS/SpreadsheetControl_WPF_API/MainWindow.xaml.cs#L43

csharp
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

csharp
{
    SpreadsheetExample example = item.Content as SpreadsheetExample;
    if (example != null)

wpf-spreadsheet-how-to-apply-conditional-formatting-to-a-range-of-cells/VB/ConditionalFormatting_WPF_Examples/MainWindow.xaml.vb#L40

vb
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

vb
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

vb
If item IsNot Nothing Then
    Dim example As SpreadsheetExample = TryCast(item.Content, SpreadsheetExample)
    If example IsNot Nothing Then

See Also

ImageSource

NavBarItem Class

NavBarItem Members

DevExpress.Xpf.NavBar Namespace