【发布时间】:2010-11-01 16:58:49
【问题描述】:
假设我有以下两个类:
public class TestResults
{
public string TestGroup {get; set; }
public string TestName {get; set; }
public bool TestPassed {get; set; }
}
public class TestSummary
{
public string TestGroup {get; set; }
public string SummaryText {get; set; }
}
我的一些测试数据可能如下所示:
TestResults
TestGroup TestName TestPassed
==========================================
Item1 HasPrice True
Item1 HasDiscount True
Item2 HasPrice True
Item2 HasDiscount False
TestSummary
TestGroup SummaryText
=================================================
Item1 SKU: 234 Price: 13.40 Discount: 1.34
Item2 SKU: 345 Pirce: 15.70
如果我有一个IEnumerable<TestResults> 和一个IEnumerable<TestSummary>,我希望能够在TestGroup 上将它们组合在一起并显示它们的信息,如下所示:
______________________________________________________________________
| Item1 _________________________ _______________________________ |
| | Grid of TestResults | | SummaryText for Item1 | |
| |_______________________| |______________________________| |
|_____________________________________________________________________|
______________________________________________________________________
| Item2 _________________________ _______________________________ |
| | Grid of TestResults | | SummaryText for Item2 | |
| |_______________________| |______________________________| |
|_____________________________________________________________________|
我有 2 个关于如何做到这一点的问题:
- 如何加入两个
IEnumerables 并将它们组合在一起,以便数据模板可以使用它们? - 我的数据模板应该是什么样子才能显示分组数据?
【问题讨论】:
标签: c# .net silverlight linq xaml