确切地< Expander Header =" {Binding}">会做什么?做? [英] What does exactly <Expander Header="{Binding}"> do?
问题描述
在创建简单的自定义扩展器时,我遇到了IT内的项目无法绑定的问题.我在此链接上找到了解决方法:
While creating a simple custom expander, I encountered the problem where items inside IT wouldn't bind. I found the fix on this link:
http://codeoverload .wordpress.com/2012/03/04/wpf-expander-headertemplates-dont-forget-the-binding/
碰巧会处理同样的问题,但是我从中了解到的是运气不错,不太确定为什么会起作用; D"
Which happens to treat that exact same issue, however what I understand from it is "found this by luck, not really sure why it worked ;D"
我现在的问题是:为什么添加Header = {Binding}可以解决此问题.确实,从事实绑定实际上是行不通的,这似乎是由于DataContext引起的,但我不知道如何解决该问题.
My question being now: why does adding Header={Binding} fixes the issue. Indeed from the fact binding wouldn't work, it seems it's due to the DataContext, but I don't see how this should fix it.
感谢您的解释;希望这不是重复的>.<
Thanks for explaining; hopefully this isn't a duplicate >.<