WPF XElement
冏程序 2014-12-25 11:24:55 XElement xDataTemplate = new XElement(ns + "DataTemplate",
new XAttribute("xmlns:x", "http://schemas.microsoft.com/winfx/2006/xaml"),
new XAttribute("xmlns:mc", "http://schemas.openxmlformats.org/markup-compatibility/2006"),
new XAttribute("xmlns:d", "http://schemas.microsoft.com/expression/blend/2008"),
new XElement(ns+"TextBlock", new XAttribute("Text", "{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type DataGridRow}}, Path=Header}")));
主要是花横线的地方,需要引用http://schemas.microsoft.com/winfx/2006/xaml这个命名空间。请高手指点下,这句代码怎么写才对?