UWP NavigationView重置扩展到标题栏设置

时间:2018-07-22 04:34:20

标签: xaml uwp uwp-xaml

我正在创建一个带有NavigationView并扩展到标题栏中的UWP应用。我的问题是,在启动时,NavView处于正确的位置:

https://imgur.com/a/shLezVQ

但是,在任何窗口大小更改后或NavView崩溃后,它将重置为:

https://imgur.com/a/PtztarW

这是我的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>

0 个答案:

没有答案