2
在Silverlight中,我试图构建报表列表框,并试图在外部报表列表框的数据模板的列表框中显示报表参数。Silverlight - 在列表框模板中绑定列表框
下面是数据类:
public class Report
{
public string Title { get; set; }
public string Description { get; set; }
public List<ReportParameter> Parameters = new List<ReportParameter>();
}
public class ReportParameter
{
public string Name { get; set; }
public string ParameterType { get; set; }
public bool Required { get; set; }
}
这里是我试图用做它的XAML:
<ListBox x:Name="lstReports">
<ListBox.ItemTemplate>
<DataTemplate>
<Border>
<StackPanel>
<TextBlock Text="{Binding Title}"/>
<ListBox ItemsSource="{Binding Parameters}" Height="60" Width="60">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
为报告工作的标题绑定,但其内每个报告的列表框都是空的。
填充参数列表。
我在做什么错?
谢谢!
谢谢Viggity!像魅力一样工作! – 2011-05-25 17:01:52
高兴地帮助:) – viggity 2011-05-27 13:11:14
感谢x1000!只有我和谷歌4小时才能找到... – Matt 2014-01-15 19:59:57