以下XAML在运行时生成XamlParseException:
<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’。
我做错了什么?
发布于 2012-11-26 23:11:33
键不可能是类型,它们是字符串。
https://stackoverflow.com/questions/13571109
复制相似问题