Xaml 为ContentTemplate绑定静态资源
如何基于绑定字符串动态使用模板(这会抱怨静态资源必须是字符串,即使绑定将返回字符串):Xaml 为ContentTemplate绑定静态资源,xaml,Xaml,如何基于绑定字符串动态使用模板(这会抱怨静态资源必须是字符串,即使绑定将返回字符串): <ContentControl ContentTemplate="{StaticResource {Binding Template}}"> <ContentPresenter /> </ContentControl> 所以模板实际上只是一个字符串,它将返回要使用的模板
<ContentControl ContentTemplate="{StaticResource {Binding Template}}">
<ContentPresenter />
</ContentControl>
所以模板实际上只是一个字符串,它将返回要使用的模板