Sdílet prostřednictvím


TabViewItem.IconSource Property

Definition

Gets or sets the icon to be displayed within the tab.

This documentation applies to WinUI 2 for UWP (for WinUI in the Windows App SDK, see the Windows App SDK namespaces).

public:
 property IconSource ^ IconSource { IconSource ^ get(); void set(IconSource ^ value); };
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
IconSource IconSource();

void IconSource(IconSource value);
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
IconSource IconSource();

void IconSource(IconSource value);
public IconSource IconSource { [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)] get; [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)] set; }
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
public IconSource IconSource { [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)] get; [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)] set; }
Public Property IconSource As IconSource

Property Value

The icon to be displayed within the tab.

Attributes
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackAttribute

Examples

<!-- xmlns:muxc="using:Microsoft.UI.Xaml.Controls" -->

<muxc:TabView>
    <muxc:TabView.TabItems>
        <muxc:TabViewItem Header="Home" IsClosable="False">
            <muxc:TabViewItem.IconSource>
                <muxc:SymbolIconSource Symbol="Home" />
            </muxc:TabViewItem.IconSource>
            <!-- The content of the TabViewItem -->
        </muxc:TabViewItem>
    </muxc:TabView.TabItems>
</muxc:TabView>

Remarks

If the Header property is set, the icon appears inside the tab UI to the left of the header content.

Applies to

See also