Back to Devexpress

SuperTipItem.Content Property

wpf-devexpress-dot-xpf-dot-core-dot-supertipitem.md

latest5.3 KB
Original Source

SuperTipItem.Content Property

Gets or sets the tooltip item’s content. This is a dependency property.

Namespace : DevExpress.Xpf.Core

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

NuGet Package : DevExpress.Wpf.Core

Declaration

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

Property Value

TypeDescription
Object

An object that represents the tooltip item’s content.

|

Remarks

To specify a template used to present the Content object in a custom manner, use SuperTipItem.ContentTemplate.

Example

The following example creates a SuperTip consisting of four items. For the second item, the default layout of the item’s Content and Glyph is changed. The glyph is positioned on the right of the Content.

For the fourth item, the style is changed, so that the text is painted in gray.

The result is shown below:

xaml
<dxb:BarButtonItem.SuperTip>
    <dxc:SuperTip>
        <!--Item 1-->
        <dxc:SuperTipHeaderItem Content="New"/>
        <!--Item 2-->
        <dxc:SuperTipItem Content="Create a new document" 
                          Glyph="pack://application:,,,/Images/new-32x32.png">
            <!--Change the default layout-->
            <dxc:SuperTipItem.LayoutStyle>
                <Style TargetType="{x:Type dxc:Items2Panel}">
                    <Setter Property="Alignment" Value="Right"/>
                    <Setter Property="HorizontalIndent" Value="20"/>
                </Style>
            </dxc:SuperTipItem.LayoutStyle>

        </dxc:SuperTipItem>
        <!--Item 3-->
        <dxc:SuperTipItemSeparator/>
        <!--Item 4-->
        <dxc:SuperTipItem Content="Opens a new document in a new tab" >
            <!--Provide content template-->
            <dxc:SuperTipItem.ContentTemplate>
                <DataTemplate>
                    <TextBlock FontFamily="Calibri" Foreground="Gray" FontSize="11" Text="{Binding}"/>
                </DataTemplate>
            </dxc:SuperTipItem.ContentTemplate>
        </dxc:SuperTipItem>
    </dxc:SuperTip>
</dxb:BarButtonItem.SuperTip>

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.

how-to-create-supertips-for-bar-items-ribbon-items-and-standard-controls-in-code-and-xaml-e2702/CS/SuperTipFromXamlForStandardControls.xaml#L11

xml
<dx:SuperTip>
    <dx:SuperTipHeaderItem Content="New"/>
    <dx:SuperTipItem Content="Create a new document" Glyph="pack://application:,,,/new-32x32.png">

wpf-diagram-mdi/CS/MainWindow.xaml#L112

xml
<dx:SuperTip>
    <dx:SuperTipHeaderItem Content="Create document" />
    <dx:SuperTipItem Content="Create a new diagram document" />

how-to-create-supertips-for-bar-items-ribbon-items-and-standard-controls-in-code-and-xaml-e2702/CS/SuperTipForRibbonFromCode.xaml.cs#L25

csharp
SuperTipHeaderItem header = new SuperTipHeaderItem();
header.Content = "New";
SuperTipItem item = new SuperTipItem();

how-to-create-supertips-for-bar-items-ribbon-items-and-standard-controls-in-code-and-xaml-e2702/VB/SuperTipForRibbonFromCode.xaml.vb#L16

vb
Dim header As SuperTipHeaderItem = New SuperTipHeaderItem()
header.Content = "New"
Dim item As SuperTipItem = New SuperTipItem()

See Also

ContentTemplate

Glyph

LayoutStyle

SuperTipItem Class

SuperTipItem Members

DevExpress.Xpf.Core Namespace