TitleBar.IsPaneToggleButtonVisible Propiedad
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Obtiene o establece un valor que indica si se muestra el botón para alternar el panel de navegación.
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 de propiedad
bool
true si se muestra el botón para alternar el panel de navegación; de lo contrario, false. El valor predeterminado es false.
- Atributos
-
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValueAttribute
Ejemplos
<!-- 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;
}
Comentarios
Al usar el control TitleBar con un control NavigationView , debe reemplazar el botón de alternancia del panel de la vista de navegación por el botón de alternancia del panel de la barra de título.
Le recomendamos que haga lo siguiente:
- Oculte el botón de alternancia del panel en el
NavigationViewcontrol .<NavigationView IsPaneToggleButtonVisible="False"> - Muestra el botón de alternancia del panel en el
TitleBarcontrol .<TitleBar IsPaneToggleButtonVisible="True"> - Controle el evento TitleBar.PaneToggleRequested para alternar el valor de la propiedad NavigationPane.IsPaneOpen .