Can I change the properties of a binding in a DataTrigger, without knowing the binding itself?

后端 未结 5 1274
甜味超标
甜味超标 2021-01-04 13:50

I have a TextBox style that formats a number if the box is unfocused, but leaves the number unformatted whlie it\'s being edited.

This is the style I wa

5条回答
  •  太阳男子
    2021-01-04 14:31

    I'm wondering if you could maybe have an attached property on the edits to hold the formatted value (just bound to the real edit value with a Stringformat applied), then in your out of focus trigger you could set the edit value to this property.

    This would result in a circular binding though when the edit doesn't have focus, dunno how WPF reacts in such situations.

提交回复
热议问题