NavigationViewTemplateSettings.OpenPaneLength 属性

定义

获取 minOpenPaneLength 与窗口宽度之间的值。 这是打开和完全展开时窗格宽度的计算值。

本文档适用于 Windows 应用 SDKWinUI 的 WinUI 2 for UWP (,请参阅Windows 应用 SDK命名空间) 。

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

属性值

Double

double

minOpenPaneLength 与窗口宽度之间的宽度。 默认值为 320.0。

属性
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValueAttribute

示例

此示例演示NavigationViewTemplateSettings.OpenPaneLength用于ControlTemplateNavigationView传递给 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}">

适用于