为什么SynchronizationContext 在WPF中很重要

因为WPF的UI操作必须在UI Thread的Dispatcher上完成。
DispatcherSynchronizationContext 是SynchronizationContext 的一个子类实现,专门为WPF服务的,定义在WindowsBase.dll里的(虽然namespace还是system.Windows.threading).有了它,和别的SynchronizationContext 实现一样,就可以使用它的Post方法。
TaskScheduler抽象类有两个子类,除了默认的新开一个线程的 ThreadPoolTaskScheduler,另一个就是SynchronizationContextTaskScheduler,它就会用SynchronizationContext 的Post方法。这样如果用TaskScheduler.FromCurrentSynchronizationContext(),就会创建一个SynchronizationContextTaskScheduler,就能够保证多线程的队列里的元素执行时都在同一个SynchronizationContext 上执行(除非手动地设置SynchronizationContext ),无论对Winform还是WPF都如此,对取数据等操作如果有SynchronizationContext 上的限制,也都有了保证。对WPF而言,这个DispatcherSynchronizationContext ,是在Dispatcher的构造函数里就和这个Dispatcher联系在一起了。它的Send会立即执行,而它的Post,就会加入Queue,而Queue的处理则是这个Dispatcher的Window Proc(处理Window message loop的自定义方法)里的事情。

被选中进入逻辑树里元素类型列表

http://www.cnblogs.com/idior/archive/2010/06/04/1751738.html

The secret is behind a property called LogicalChildren. Panel, ItemsControl, ContentControl, and Decorator, which are the most common base classes, all define this property make the logical tree operate already.
LogicalChildren是用来实现以下列出的功能的,定义在基类FrameworkElement之上,而原文的列表里的Items,Children,Content之类的的属性是各个类自己维护的属性。LogicalChildren是以下关键能力实现的基础:
继承DependencyProperty(wpf的重要而容易被忽略的特性就是dp可以从树上的父元素获得)
DynamicResource的寻找
对名字的支持(NameScope传递)
RoutedEvent的发生和传导