我正在创建一个针对Windows的Anniversary Build的新UWP Blank App项目.这是我唯一页面的标记(默认模板名为MainPage.xaml):
<Page
x:Class="App1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App1"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid.Resources>
<DataTemplate x:Key="MyDataTemplate" x:DataType="local:BindyThing">
</DataTemplate>
</Grid.Resources>
</Grid>
Run Code Online (Sandbox Code Playgroud)
BindyThing类在CS文件中声明如下:
namespace App1
{
public class BindyThing
{
}
}
Run Code Online (Sandbox Code Playgroud)
正如您从上面的标记中看到的,我正在尝试创建一个DataTemplate来呈现BindyThing.但是,当我编译时,我收到以下错误:
The XAML Binary Format (XBF) generator reported syntax error '0x09C4' : Property Not Found
当我注释掉DataTemplate的声明时,此错误消失.有没有人知道为什么我得到这个?所有帮助赞赏.谢谢!
看起来你的xaml中没有空白的DataTemplate元素.我能够让你的例子与下面的工作:
<DataTemplate x:Key="MyDataTemplate" x:DataType="local:BindyThing">
<TextBlock></TextBlock>
</DataTemplate>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2814 次 |
最近记录: |