Hyperlinks are staying inactive after setting isEnabled=true to parent control

后端 未结 3 1568
灰色年华
灰色年华 2021-01-02 02:13

I\'ve got a TabItem contanining a listbox, which has an obeservable collection of my feeds class as its item source. When I refresh/load the feeds into the collection I want

3条回答
  •  生来不讨喜
    2021-01-02 03:09

    I found the answer for my case of the hyperlink not getting re-enabled, not sure if it applies to yours:

    I found that when the Hyperlink's parent control is disabled (IsEnabled=false), the Hyperlink will not get notified of changes, e.g. IsEnabledChanged does not get fired, even when the bound property changes value.

    My solution was to change my Xaml to no longer disable the ancestor control (which was causing the Hyperlink's parent to be disabled). With the parent (TextBlock) always enabled, now Hyperlink updates properly always.

    (I'm a little bothered that the IsEnabled binding behaves differently than Controls do, and I'm not sure what I would do if I couldn't leave the ancestor enabled... but at least this lets me understand the issue I was having, and lets me work around it.)

    Details: WPF 3.5 SP1

提交回复
热议问题