TextBox ConvertBack event doesn't fire for XML element

后端 未结 1 1858
予麋鹿
予麋鹿 2021-01-22 07:25

ValueFormattingConverter.Convert is called with the XmlElement. ConvertBack is never called. Why? Is there some obligation to pass bind

相关标签:
1条回答
  • 2021-01-22 08:09

    The binding direction to source won't work with a {Binding Path=.}. This is because there is no bound property, but just the binding source object.

    Hence there will never be a source update, and the ConvertBack method is never called, because that would mean to replace the source object.

    In order to make your code work, you would have to bind to some property:

    <TextBox Text="{Binding Path=SomeElement, ...}"/>
    
    0 讨论(0)
提交回复
热议问题