TitleBar.IsPaneToggleButtonVisible 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 une valeur qui indique si le bouton permettant de basculer le volet de navigation est affiché.
public:
property bool IsPaneToggleButtonVisible { bool get(); void set(bool value); };
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="false")]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="false")]
bool IsPaneToggleButtonVisible();
void IsPaneToggleButtonVisible(bool value);
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="false")]
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="false")]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="false")]
bool IsPaneToggleButtonVisible();
void IsPaneToggleButtonVisible(bool value);
public bool IsPaneToggleButtonVisible { [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="false")] get; [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="false")] set; }
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="false")]
public bool IsPaneToggleButtonVisible { [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="false")] get; [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="false")] set; }
var boolean = titleBar.isPaneToggleButtonVisible;
titleBar.isPaneToggleButtonVisible = boolean;
Public Property IsPaneToggleButtonVisible As Boolean
Valeur de propriété
bool
true si le bouton pour activer/désactiver le volet de navigation s’affiche ; sinon, false. La valeur par défaut est false.
- Attributs
-
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValueAttribute
Exemples
<!-- MainWindow.xaml -->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TitleBar Title="My App"
IsPaneToggleButtonVisible="True"
PaneToggleRequested="TitleBar_PaneToggleRequested">
</TitleBar>
<NavigationView x:Name="RootNavigationView" Grid.Row="1"
IsPaneToggleButtonVisible="False">
<Frame x:Name="RootFrame" />
</NavigationView>
</Grid>
// MainWindow.xaml.cs
private void TitleBar_PaneToggleRequested(TitleBar sender, object args)
{
RootNavigationView.IsPaneOpen = !RootNavigationView.IsPaneOpen;
}
Remarques
Lorsque vous utilisez le contrôle TitleBar avec un contrôle NavigationView , vous devez remplacer le bouton bascule du volet de navigation de l’affichage de navigation par le bouton bascule du volet de la barre de titre.
Nous vous recommandons de :
- Masquez le bouton bascule du volet dans le
NavigationViewcontrôle.<NavigationView IsPaneToggleButtonVisible="False"> - Afficher le bouton bascule du volet dans le
TitleBarcontrôle.<TitleBar IsPaneToggleButtonVisible="True"> - Gérez l’événement TitleBar.PaneToggleRequested pour activer/désactiver la valeur de la propriété NavigationPane.IsPaneOpen .