for (var i = 0; i < Pathlist.Count; i++)
{
///xmal语言
string StrXmal = "<Grid xmlns=‘http://schemas.microsoft.com/winfx/2006/xaml/presentation‘ Grid.Row=‘" + i + "‘><Button xmlns=‘http://schemas.microsoft.com/winfx/2006/xaml/presentation‘ Tag=‘"+ Pathlist[i][1]+ "‘ Name=‘UserManage" + i + "‘ Content=‘"+ Pathlist[i][0]+ "‘ HorizontalAlignment=\"Center\" Margin=\"0,0,0,0\" VerticalAlignment=\"Center\" ></Button></Grid> ";
///实例化 StringReader
StringReader strreader = new StringReader(StrXmal);
/// 实例化 XmlTextReader
XmlTextReader Xmalread = new XmlTextReader(strreader);
///定义一个 obj来加载此类型
object obj = XamlReader.Load(Xmalread);
/// 强转控件 并且添加进去。
Butgrid.Children.Add((UIElement)obj);
}