Sha*_*ish 5 xaml win-universal-app windows-10
在库中编译XAML时出现以下错误:
主题\ Generic.xaml(35,12):XamlCompiler错误WMC0610:XBF生成错误代码0x03e9.
它失败的XAML代码(第35行)是:
<Style TargetType="annotations:CanvasAnnotationItem" xmlns:annotations="using:ACME.Controls.CanvasAnnotation">
Run Code Online (Sandbox Code Playgroud)
没有额外的信息来帮助解决错误.
出于某种原因,XAML编译器不知道如何处理该本地命名空间(直接在该样式上定义的命名空间).将其移动到文件顶部可以解决问题:
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:annotations="using:ACME.Controls.CanvasAnnotation"
xmlns:local="using:ACME.Controls">
Run Code Online (Sandbox Code Playgroud)
在元素本身:
<Style TargetType="annotations:CanvasAnnotationItem">
Run Code Online (Sandbox Code Playgroud)