Xaml 如何在列表中的每一行之间画线?
下面给出的代码用于获取列表的每一行Xaml 如何在列表中的每一行之间画线?,xaml,windows-phone-7,Xaml,Windows Phone 7,下面给出的代码用于获取列表的每一行 <ListBox x:Name="List" HorizontalAlignment="Left" Height="575" Margin="6,0,0,0" VerticalAlignment="Top" Width="443" SelectionChanged="List_SelectionChanged_1"> <ListBox.ItemTemplate> <DataT
<ListBox x:Name="List" HorizontalAlignment="Left" Height="575" Margin="6,0,0,0" VerticalAlignment="Top" Width="443" SelectionChanged="List_SelectionChanged_1">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Width="430" Height="80">
<Grid Margin="0,0,0,0" Height="90" Width="305">
<TextBlock HorizontalAlignment="Left" Height="60" Margin="0,0,0,0" FontWeight="Medium" TextWrapping="Wrap" Text="{Binding Name}" VerticalAlignment="Top" Width="268" FontSize="25"/>
<TextBlock HorizontalAlignment="Left" Height="60" Margin="0,36,0,-1" TextWrapping="Wrap" Text="{Binding TaxType}" VerticalAlignment="Top" Width="259" Foreground="Gray" FontSize="16"/>
</Grid>
<StackPanel Orientation="Horizontal" Margin="0,0,0,0" FlowDirection="RightToLeft" Grid.Row="0" Width="125" HorizontalAlignment="Right">
<TextBlock Text="{Binding Percentage}" FontSize="23" VerticalAlignment="Center" HorizontalAlignment="Right" FontFamily="Portable User Interface" Height="75"/>
</StackPanel>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
现在,我如何在堆栈面板的末尾(即列表中的每一行之间)画一条线在堆栈面板的所有其他行下面,应用以下内容:
<Path Data="M0,0 L1,1 M0,1 L1,0" Stretch="Uniform" Stroke="Red" />
您需要做的是,将当前数据添加到stackpanel中,然后添加上一个答案中提到的路径,并将这两个数据放置在方向=水平的stackpanel中