<ListBox x:Name="myListBox" ItemsSource="{Binding}" HorizontalAlignment="Left" Height="500" Margin="10,10,0,0" VerticalAlignment="Top" Width="420" ItemTemplate="{DynamicResource NewsDataTemplate}"/>
<TextBlock Text="{Binding Path=Title, FallbackValue=Title}" />
<ListBox ItemsSource="{Binding}">
<ListBox.ItemTemplate>
<DataTemplate DataType="local:Line">
<TextBlock Text="{Binding Title}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
public MainWindow()
{
InitializeComponent();
var lines = new List<Line>();
lines.Add(new Line() { Title = "1" });
lines.Add(new Line() { Title = "2" });
lines.Add(new Line() { Title = "3" });
this.DataContext = lines;
}
public class Line
{
public string Title { get; set; }
}