Лучше всего использовать переплет. Смотрите мой код ниже:
<ListBox x:Name="List1">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding ID}" />
<TextBlock Text="{Binding Name}" Grid.Column="1" />
<TextBlock Text="{Binding Description}" Grid.Column="2" />
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<TextBlock Grid.Row="2" Text="{Binding ElementName=List1,Path=SelectedItem.ID}" />
// CSharp Code:
public partial class MainPage : PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
Collection<Entity> source = new Collection<Entity> {
new Entity{ID = "1", Name = "Name1", Description = "This is Name1"},
new Entity{ID = "2", Name = "Name2", Description = "This is Name2"},
new Entity{ID = "3", Name = "Name3", Description = "This is Name3"},
};
List1.ItemsSource = source;
}
}
public class Entity
{
public string ID { get; set; }
public string Name { get; set; }
public string Description { get; set; }
}