Design time error while writing Nested type in xaml

旧巷老猫 提交于 2019-12-06 09:40:01

According to Rob Relyea form Microsoft this is a defect within the VS2008/2010 designer.

We had somebody look at the use of {x:Type Foo+Bar} pattern and test it in VS2010 and Blend4. It appears that it works fine at Runtime, CompileTime, in Blend 4, but fails in VS2010's WPF Designer.

We've filed a bug, and routed it to the WPF Designer team.

Bizhan

According to this post You need to make use of the capabilities the MarkupExtension class provides.

however there is another way around it:

<ObjectDataProvider 
    MethodName="GetValues"
    ObjectType="{x:Type sys:Enum}"
    x:Key="NestedEnumDataProvider">
    <ObjectDataProvider.MethodParameters>
        <x:Type TypeName="myNamespace:ParentType+NestedType"/>
    </ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!