首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >WPF baml序列化错误?

WPF baml序列化错误?
EN

Stack Overflow用户
提问于 2012-11-26 18:43:17
回答 1查看 343关注 0票数 1

以下XAML在运行时生成XamlParseException

代码语言:javascript
复制
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:sys="clr-namespace:System;assembly=mscorlib">
  <Grid>
    <Grid.Resources>
      <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
          <ResourceDictionary>
            <TextBlock x:Key="{x:Type TextBlock}">
              <Run Text="Aaaa"/>
            </TextBlock>
          </ResourceDictionary>
        </ResourceDictionary.MergedDictionaries>
        <sys:String x:Key="aaa"></sys:String>
      </ResourceDictionary>
    </Grid.Resources>
    <Border Child="{StaticResource {x:Type TextBlock}}"/>
  </Grid>
</Window>

XamlParseException:'TextBlock‘对象缺少键值。行号'10‘和线位置'20’。

我做错了什么?

EN

回答 1

Stack Overflow用户

发布于 2012-11-26 23:11:33

键不可能是类型,它们是字符串。

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13571109

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档