【发布时间】:2023-01-24 03:59:35
【问题描述】:
WinUI3 Gallery 中 NavigationView 的默认外观或使用模板工作室创建的应用程序在顶部有一个空间。但是,它在使用 Visual Studio 默认模板创建的应用程序中看起来有所不同。我不认为它是由 ViewModel 或其他任何东西控制的。为什么看起来不一样?
<!--In Template studio or WinUI3 Gallery-->
<Page>
<Grid>
<NavigationView PaneDisplayMode="LeftCompact"/>
</Grid>
</Page>
<!--In My App created with Visual Studio default templates-->
<Page>
<Grid>
<NavigationView PaneDisplayMode="LeftCompact"/>
</Grid>
</Page>
In Template studio or WinUI3 Gallery
In My App created with Visual Studio default templates
即使您如下修改使用 Template Studio 创建的应用程序的 ShellPage,外观仍然存在差异。
public sealed partial class ShellPage : Page
{
public ShellPage()
{
InitializeComponent();
}
}
<Page
x:Class="TemplateStudioApp.Views.ShellPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
<NavigationView PaneDisplayMode="LeftCompact"/>
</Page>
【问题讨论】:
标签: xaml winrt-xaml winui-3