我正在创建一个带有NavigationView并扩展到标题栏中的UWP应用。我的问题是,在启动时,NavView处于正确的位置:
但是,在任何窗口大小更改后或NavView崩溃后,它将重置为:
这是我的NavigationView,我以编程方式填充NavViewItems。我还将标题栏设置为XAML中的底部网格元素。
<Grid>
<NavigationView x:Name="navView"
AlwaysShowHeader="False"
Loaded="navView_Loaded"
ItemInvoked="navView_ItemInvoked"
BackRequested="navView_BackRequested"
Background="{ThemeResource SystemControlAcrylicElementBrush}"
>
<NavigationView.AutoSuggestBox>
<AutoSuggestBox QueryIcon="Find"
x:Name="navSearch"
TextChanged="navSearch_TextChanged"
QuerySubmitted="navSearch_QuerySubmitted"
PlaceholderText="Search Documents"
/>
</NavigationView.AutoSuggestBox>
<Frame x:Name="navFrame"/>
</NavigationView>
<Grid x:Name="titleBarGrid" Background="Transparent" Margin="50, 0, 150, 0" Height="44" VerticalAlignment="Top"/>
</Grid>