【发布时间】:2016-07-25 07:06:27
【问题描述】:
假设我有:
class Employee
{
public string Name;
public string Id;
// ...
}
<DataTemplate DataType="local:Employee"> ... </DataTemplate>
和:
class Manager
{
public string Salary;
public int Rank;
public Employee DirectReport;
}
在引用Employee DataTemplate 的同时,如何为Manager 编写DataTemplate?
即:
<DataTemplate DataType="local:Manager">
<TextBlock Text={Binding Salary}/>
<TextBlock Text={Binding Rank}/>
// How do I display the DirectReport here using Employee's DataTemplate?
</DataTemplate>
【问题讨论】: