在VS2010中会出现编译错误:“ System.Windows.Markup.IQueryAmbient' is defined in an assembly that is not referenced . You must add a reference to assembly 'System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ”。
原因就是原有的System.windows.markup命名空间当中的类和接口有相当一部分从过去的Windowsbase.dll移植到了System.xaml.dll当中。因此需要添加对System.xaml.dll的引用。