【问题标题】:How do I Programmatically set ContentTemplate of ContentControl如何以编程方式设置 ContentControl 的 ContentTemplate
【发布时间】:2012-11-08 04:54:18
【问题描述】:

谁能把它翻译成 C# 代码:

    <ContentControl Name="test" ContentTemplate="{StaticResource myA}"/>

【问题讨论】:

    标签: wpf data-binding binding


    【解决方案1】:
    test.ContentTemplate = (DataTemplate) FindResource("myA");
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-15
      • 1970-01-01
      • 2019-04-13
      • 2011-12-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多