我有一个List of TreeViewItems,其中包含StackPanels作为Headers.If,我在这些标头中使用了string,我可以使用如下一行
tempList = tempList.OrderBy(a => a.Header.ToString()).ToList();但是现在Header是StackPanel,StackPanel有Image和TextBlock。TextBlock包含一个运行。我想按这些“Runt.ext”对tempList进行排序..。
有人知道我是怎么做到的吗?
发布于 2016-04-26 09:57:33
好的。是我自己发现的。我以为会更难。
tempList = tempList.OrderBy(a => ((Run)((TextBlock)((StackPanel)a.Header).Children[1]).Inlines.FirstInline).Text).ToList();https://stackoverflow.com/questions/36860055
复制相似问题