我有一个ObservableCollection<testItem>
,每个testItem
人都有另一个ObvervableCollection<testData>
。
知道每个testData
我想要的和来自ListItem
的一些数据。目前我将列表设置为as但我只得到了.testItem
testData
ObservableCollection<testItem>
ItemsSource
itemsData
我能做些什么?
更新:
xml:
<ListBox Name="ResultList" ItemsSource="{Binding TankstellenItem}" >
<ListBox.ItemTemplate>
<DataTemplate>
<Border BorderBrush="#FF3AACDF" BorderThickness="4">
<StackPanel Orientation="Horizontal"
Background="White"
UseLayoutRounding="True" Tap="ItemIsClicked">
<StackPanel Width="130" Orientation="Vertical" Margin="0,0,0,0">
<Border BorderThickness="2"
Background="#FF3AACDF" BorderBrush="White">
<TextBlock Text="{Binding PriceBigDigits}"
FontFamily="Assets/Font.ttf#LCD"
FontSize="25" TextAlignment="Center" />
</Border>
<TextBlock Text="{Binding FuelType}"
TextAlignment="Center"
FontSize="15" Foreground="Black"/>
<TextBlock Text="{Binding UpdateDate}"
TextAlignment="Center"
FontSize="15" Foreground="Black" />
<TextBlock Text="{Binding DistanceString}"
TextAlignment="Center"
FontSize="15" Foreground="Black"/>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="10,0,0,0" Width="400">
<TextBlock Text="{Binding Title}"
FontSize="30" FontWeight="Bold" Foreground="Black"/>
<TextBlock Text="{Binding Address}" FontSize="20" Foreground="Black" />
<TextBlock Text="{Binding PLZCity}" FontSize="20" Foreground="Black" />
</StackPanel>
</StackPanel>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
比我有testItem:
public testItem{
DistanceString (string),
Title (string),
Addresse (string),
PLZCity (string),
itemDates (ObservableCollection<itemData>)}
和 itemData:
public itemData{
PriceBigDigits (string),
FuelType (string),
UpdateDate (string)