TitleBar.IsPaneToggleButtonVisible Propriedade
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Obtém ou define um valor que indica se o botão para alternar o painel de navegação é mostrado.
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
Valor da propriedade
bool
true se o botão para alternar o painel de navegação for mostrado; caso contrário, false. O padrão é false.
- Atributos
-
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValueAttribute
Exemplos
<!-- 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;
}
Comentários
Ao usar o controle TitleBar com um controle NavigationView , você deve substituir o botão de alternância do painel de navegação pelo botão de alternância do painel da barra de título.
É recomendável que você:
- Oculte o botão de alternância do painel no
NavigationViewcontrole.<NavigationView IsPaneToggleButtonVisible="False"> - Mostrar o botão de alternância do painel no
TitleBarcontrole.<TitleBar IsPaneToggleButtonVisible="True"> - Manipule o evento TitleBar.PaneToggleRequested para alternar o valor para a propriedade NavigationPane.IsPaneOpen .