Langage

TitleBar.Title Propriété

Définition

Obtient ou définit le texte du titre à afficher dans la barre de titre.

public:
 property Platform::String ^ Title { Platform::String ^ get(); void set(Platform::String ^ value); };
winrt::hstring Title();

void Title(winrt::hstring value);
public string Title { get; set; }
var string = titleBar.title;
titleBar.title = string;
Public Property Title As String

Valeur de propriété

String

Platform::String

winrt::hstring

Texte de titre à afficher dans la barre de titre. La valeur par défaut est une chaîne vide.

Exemples

Cet exemple montre comment lier la Title propriété à celle de DisplayNamel’application.

xmlns:appmodel="using:Windows.ApplicationModel"

<TitleBar Title="{x:Bind appmodel:AppInfo.Current.DisplayInfo.DisplayName}"/>

Vous pouvez également le définir dans le code.

using Windows.ApplicationModel;

TitleBar titleBar = new TitleBar();
titleBar.Title = AppInfo.Current.DisplayInfo.DisplayName;

Cet exemple montre comment définir la Title propriété sur une chaîne littérale.

<TitleBar Title="My App"/>
TitleBar titleBar = new TitleBar();
titleBar.Title = "My App";

Remarques

Le titre est généralement utilisé pour afficher le nom d’affichage de l’application.

Lorsque le TitleBar mode d’affichage est compact, les éléments et Subtitle les Title éléments ne sont pas affichés.

S’applique à