3

我是在 stackoverflow 上发帖的新手,也是在 C# 中为 Microsoft Surface 编码的新手——但是我继承了别人的代码来适应。

尝试设置 ByteTagVisualizationDefinition 的源时出现以下错误

'markup://1/file:///C:/Users/PJ/Documents/Visual Studio 2010/Projects/Rememo/Rememo/SurfaceWindow1.xaml%230/reminderTags.xaml' is not a valid value for property 'Source'.

at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal) at 

Microsoft.Expression.Platform.WPF.WpfDependencyPropertyImplementation.SetValue(Object target, Object valueToSet) at 
Microsoft.Expression.DesignModel.Metadata.DependencyPropertyReferenceStep.SetValue(Object target, Object valueToSet) at 
Microsoft.Expression.DesignModel.Core.InstanceBuilderOperations.SetValue(Object target, IProperty propertyKey, Object value) at 
Microsoft.Expression.DesignModel.InstanceBuilders.ClrObjectInstanceBuilder.ModifyValue(IInstanceBuilderContext context, ViewNode target, IProperty propertyKey, Object value, PropertyModification modification) at 
Microsoft.Expression.DesignModel.InstanceBuilders.DependencyObjectInstanceBuilderBase`1.ModifyValue(IInstanceBuilderContext context, ViewNode target, IProperty propertyKey, Object value, PropertyModification modification) at 
Microsoft.Expression.DesignModel.InstanceBuilders.ClrObjectInstanceBuilder.UpdateProperty(IInstanceBuilderContext context, ViewNode viewNode, IProperty propertyKey, DocumentNode valueNode)

随着

Error 1 'markup://1/file:///C:/Users/PJ/Documents/Visual Studio 2010/Projects/Rememo/Rememo/SurfaceWindow1.xaml%230/reminderTags.xaml' 
is not a valid value for property 'Source'. C:\Users\PJ\Documents\Visual Studio 2010\Projects\Rememo\Rememo\SurfaceWindow1.xaml 

我试图访问此源的代码是:

<Grid Background="{StaticResource WindowBackground}">
  <s:TagVisualizer>
      <s:TagVisualizer.Definitions>
         <s:ByteTagVisualizationDefinition Value="0xC0" Source="reminderTags.xaml" />
      </s:TagVisualizer.Definitions>
  </s:TagVisualizer>

当我编译代码并在 Surface Simulator 上运行它时,它会成功运行 - 我不知道为什么会出现这个错误?我正在按照微软教程进入这个阶段,现在对出了什么问题感到有些茫然。

4

0 回答 0