I keep getting an error in this xaml file:
The property 'VisualTree' is set more than once.
<ListBox x:Name="lstHistory" HorizontalAlignment="Left" Margin="12,284,0,90" Width="460"
ItemsSource="{Binding
Source={StaticResource SongCollection},
Path=DataCollection}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Image Margin="5" VerticalAlignment="top" Source="{Binding Path=Image}" />
</StackPanel>
<TextBlock Margin="8" Width="250"
TextWrapping="Wrap"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Text="{Binding Path=Name}" />
<TextBlock Width="100"
Margin="8,0,8,8"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Text="{Binding Path=Artist}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
Anyone who can help?
DataTemplate can only have 1 child. you've got 2 (stackpanel and textblock). wrap those in single container and all will be well
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With