Share via


TitleBar.IsPaneToggleButtonVisible Property

Definition

Gets or sets a value that indicates whether the button to toggle the navigation pane is shown.

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

Property Value

Boolean

bool

true if the button to toggle the navigation pane is shown; otherwise, false. The default is false.

Attributes
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValueAttribute

Examples

<!-- 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;
}

Remarks

When you use the TitleBar control with a NavigationView control, you should replace the navigation view's pane toggle button with the title bar's pane toggle button.

We recommend that you:

  • Hide the pane toggle button in the NavigationView control. <NavigationView IsPaneToggleButtonVisible="False">
  • Show the pane toggle button in the TitleBar control. <TitleBar IsPaneToggleButtonVisible="True">
  • Handle the TitleBar.PaneToggleRequested event to toggle the value for the NavigationPane.IsPaneOpen property.

Applies to

See also