Share via


NavigationViewTemplateSettings.OpenPaneLength Property

Definition

Gets the min between OpenPaneLength and the window's width. This is the calculated value of the width of the pane when opened and fully expanded.

This documentation applies to WinUI 2 for UWP (for WinUI in the Windows App SDK, see the Windows App SDK namespaces).

public:
 property double OpenPaneLength { double get(); };
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="320.0")]
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="320.0")]
double OpenPaneLength();
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="320.0")]
public double OpenPaneLength { [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="320.0")] get; }
Public ReadOnly Property OpenPaneLength As Double

Property Value

Double

double

The min between OpenPaneLength and the window's width. Defaults to 320.0.

Attributes
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValueAttribute

Examples

This example shows the NavigationViewTemplateSettings.OpenPaneLength property being used in the ControlTemplate for NavigationView to pass through to the Windows.UI.Xaml.Controls.SplitView.OpenPaneLength.

<ControlTemplate TargetType="NavigationView">
    <!-- ... -->
    <SplitView
        OpenPaneLength="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.OpenPaneLength}"
        Background="{TemplateBinding Background}"
        BorderBrush="{ThemeResource NavigationViewItemSeparatorForeground}"
        BorderThickness="{ThemeResource NavigationViewBorderThickness}"
        CompactPaneLength="{TemplateBinding CompactPaneLength}"
        DisplayMode="Inline"
        IsPaneOpen="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsPaneOpen, Mode=TwoWay}"
        IsTabStop="False"
        PaneBackground="{ThemeResource NavigationViewDefaultPaneBackground}">

Applies to