在 x:DataType 上不断出现错误

Keep getting error on x:DataType

我收到“来自 XAML 命名空间的属性 'DataType' 未定义。 [XAML 命名空间中的属性 'DataType' 未定义][1]

<Page
   x:Class="VisitorApp.sample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:VisitorApp"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:data="using:VisitorApp.Common" 
mc:Ignorable="d">
    <Page.Resources>
        <DataTemplate x:Key="GuestListDataTemplate" x:DataType="data:GuestGlobal">
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                <StackPanel Margin="20,20,0,0">
                <TextBlock Text="{Binding GuestName}" HorizontalAlignment="Left" FontSize="16" />
                <TextBlock Text="{x:Bind HostName}" HorizontalAlignment="Left" FontSize="10" />
                </StackPanel>
            </StackPanel>
       </DataTemplate>
    </Page.Resources>
    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Margin="0,20,20,0">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="100" />
        </Grid.RowDefinitions>
        <TextBlock Grid.Row="1" 
               Name="ResultTextBlock" 
               FontSize="24" 
               Foreground="Red" 
               FontWeight="Bold" 
               Margin="20,20,0,0" />
        <GridView ItemsSource ="{x:Bind Guests}" 
              ItemClick="ListView_ItemClick" 
              IsItemClickEnabled="True" 
              ItemTemplate="{StaticResource GuestListDataTemplate}">
        </GridView>
    </Grid>
</Page>

强文本

这对我有帮助 https://msdn.microsoft.com/en-us/magazine/mt683802

感谢大家的贡献。