为什么 xaml 标签页属性本地在这种情况下不起作用?

Why xaml tabbed page attribute local is not working in this case?

我有一个非常简单的 xaml 代码,但是属性 local:Page 根本不起作用,当我键入 "local" 时,它会带有下划线,就好像有错误一样。

MainPage.xaml:

<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:Solution;assembly=Solution"
             x:Class="Solution.MainPage">

    <local:Listar Title="XXXX" />

</TabbedPage>

Listar.xaml:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:Solution;assembly=Solution"
             x:Class="Solution.Listar">
    <ContentPage.Content>
        <StackLayout>
            <Label Text="Welcome to Xamarin.Forms!"
                VerticalOptions="CenterAndExpand" 
                HorizontalOptions="CenterAndExpand" />
        </StackLayout>
    </ContentPage.Content>
</ContentPage>

TabbedPage 必须包含子页面。

<TabbedPage.Children>

        <local:Listar Title="XXX"/>

</TabbedPage.Children>

尝试使用下面的代码

<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         xmlns:local="clr-namespace:Solution"
         x:Class="Solution.MainPage">
 <ContentPage Title="Main">
    <ContentPage.ToolbarItems>
        <ToolbarItem Text="xxx" Order="Primary"/>
    </ContentPage.ToolbarItems>
    <StackLayout>
       //. . .
    </StackLayout>
 </ContentPage>
  <local:Listar Title="XXXX" >
</TabbedPage>