【问题标题】:Silverlight three state checkbox implementation via two statesSilverlight 三态复选框通过两种状态实现
【发布时间】:2012-03-14 14:09:07
【问题描述】:

我需要根据第一个值按以下方式处理三态复选框:

  • 如果checkbox处于选中状态则只能不选中。

  • 如果复选框处于未选中状态,则只能选中。

  • 如果复选框处于中间状态,则只能选中。

您能否建议如何实施?

【问题讨论】:

  • 嗨,我已经解决了,使用 Unchecked、checked 和 indeterminate 事件
  • 您应该发布您的决议作为答案,以造福他人。

标签: silverlight silverlight-4.0 silverlight-toolkit


【解决方案1】:

这个问题可以通过内置的复选框解决。也就是说,使用 Unchecked、checked 和 indeterminate 事件。 More info on microsoft.com

【讨论】:

    【解决方案2】:

    要解决您的问题,您应该处理树事件并设置附加属性

    IsThreeState为真,看例子:

    <checkbox IsThreeState="True"
    Indeterminate="checkbox_Indeterminate"
    Unchecked="checkbox_Unchecked" Checked="checkbox_Checked"
    Content="Click me!"/>
    

    【讨论】:

      猜你喜欢
      • 2018-11-14
      • 1970-01-01
      • 2016-06-15
      • 1970-01-01
      • 2018-05-04
      • 2016-10-26
      • 2011-03-07
      • 2014-06-06
      • 2020-08-04
      相关资源
      最近更新 更多