4
我有了它的ItemsSource绑定为WPF刷新静态资源
ItemsSource="{Binding Source={StaticResource documentTemplates}}"
哪里documentTemplates是
<ObjectDataProvider x:Key="documentTemplates"
ObjectType="{x:Type Core:DataHelper}"
MethodName="GetDocumentTemplates"/>
我的问题是,在数据库中定义的文档模板可以通过改变组合框应用程序的其他区域(或者其他用户),所以我希望每次都有ItemsSource重新查询。目前,一旦资源被填充,它将永远不会被重新查询。我假设这是因为它是一个StaticResource,但是如果我将它换成DynamicResource,我得到
无法在'Binding'类型的'Source'属性上设置'DynamicResourceExtension'。 'DynamicResrouceExtension'只能在DependencyProperty或DependencyObject上设置
我应该如何解决这个问题?