这对我很有效:
<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="333" Width="454">
<Window.Resources>
</Window.Resources>
<StackPanel Name="myStackPanel">
</StackPanel>
</Window>
int[] items = new[] { 42, 43, 44, 45 };
myStackPanel.Orientation = Orientation.Horizontal;
foreach (int item in items)
{
TextBlock txtNum = new TextBlock();
txtNum.Text = item.ToString();
TextBlock txtSeperator = new TextBlock(); // or image, as you wish
txtSeperator.Text = "->";
myStackPanel.Children.Add(txtNum);
myStackPanel.Children.Add(txtSeperator);
}