@Nico Zhu (Shanghai Wicresoft Co,.Ltd.) , Thank you for your response.
Along with your code, I set the Visibility of AppTitleBar to collapsed.
Below is my working code:
<Page
x:Class="NavBarTestOldversion.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:NavBarTestOldversion"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="Gray">
<Border BorderBrush="Red" BorderThickness="1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition />
</Grid.RowDefinitions>
<Grid x:Name="AppTitleBar" Background="Transparent" Visibility="Collapsed"/>
<NavigationView Grid.Row="1" Name="NaveView" Canvas.ZIndex="1"
CompactModeThresholdWidth="200"
ExpandedModeThresholdWidth="10000"
IsSettingsVisible="True" IsPaneToggleButtonVisible="True" />
</Grid>
</Border>
</Page>
CodeBehind:
public MainPage()
{
this.InitializeComponent();
var coreTitleBar = CoreApplication.GetCurrentView().TitleBar;
coreTitleBar.ExtendViewIntoTitleBar = true;
coreTitleBar.LayoutMetricsChanged += CoreTitleBar_LayoutMetricsChanged;
// Set XAML element as a draggable region.
Window.Current.SetTitleBar(AppTitleBar);
}
private void CoreTitleBar_LayoutMetricsChanged(CoreApplicationViewTitleBar sender, object args)
{
AppTitleBar.Height = sender.Height;
}