TitleBar.Title Propriété
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
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é
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.