首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年11月25日

摘要: IntroductionA very common and popular way to synchronize data between the model and the view in WPF is using DataBinding. The value of the model is transferred to the view once, when the binding is initialized. But for every subsequent change, the model must notify the binding to transfer the value 阅读全文

posted @ 2012-11-25 14:42 Alex Geng 阅读(163) 评论(0) 推荐(0)

摘要: If you want to listen to changes of a dependency property, you can subclass the type that defines the property and override the property metadata and pass an PropertyChangedCallback. But an much easier way is to get the DependencyPropertyDescriptor and hookup a callback by calling AddValueChanged()D 阅读全文

posted @ 2012-11-25 11:29 Alex Geng 阅读(137) 评论(0) 推荐(0)

摘要: If you are a child element of a user interface and you want to access data from a parent element, but you don't know how many levels up that elemens is, it's the best solution to navigate up the tree until it finds an element of the requested type.This helper does excactly this. You can use 阅读全文

posted @ 2012-11-25 10:59 Alex Geng 阅读(133) 评论(0) 推荐(0)