{0} is not valid for Setter.Value. The only supported MarkupExtension types are DynamicResourceExtension and BindingBase or derived types

好久不见. 提交于 2019-12-19 03:25:23

问题


iv'e got a XAML issue , in a project where working on vs2010 we use our own CustomBinding when using DynamicResource in my XAML the Designer throughs me the following expception :

CustomBinding is not valid for Setter.Value. 
The only supported MarkupExtension types are  
DynamicResourceExtension and BindingBase or derived types.    

even though it's not in use in that particular Extention..

<SomeControl Value="{CustomBinding SomeValue} 
             Style="{DynamicResource SomeStyle}" />

Style="{DynamicResource SomeStyle}" is the part which throws the design time exception and the style is never set as a result .

if any one came across a similar issue , please advise . thanks.


回答1:


Setter.Value used in your Style only support some hardcoded classes (StaticResource, DynamicResource and BindingBase) because providing of a value has to be deferred to the point when Styles are applied and it seems they had not enough time to implement it properly so they check for the supported classes and apply them later.



来源:https://stackoverflow.com/questions/12881020/0-is-not-valid-for-setter-value-the-only-supported-markupextension-types-are

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!