【问题标题】:How do I select a template for a GroupBox based on the value of an object如何根据对象的值为 GroupBox 选择模板
【发布时间】:2010-12-03 13:56:38
【问题描述】:

我希望按值选择组框的内容,那么如何编写 XAML 来做到这一点?

<GroupBox Header="Specific details"
    ContentTemplateSelector={StaticResource someSelector}>

...

</GroupBox>

模板选择器将让我选择要使用的模板,但我想不通的是将这个组框与变量中的值相关联的语法?

【问题讨论】:

    标签: .net wpf groupbox contenttemplateselector


    【解决方案1】:

    答案是使用没有标题的 TabControl,并让 SelectedIndex 由值设置。

    【讨论】:

      猜你喜欢
      • 2020-09-28
      • 2018-02-16
      • 2019-11-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多