2013-11-26 73 views
0

下面給出的是使用得到的列表的每行的代碼,如何在列表中的每一行之間畫線?

<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> 

現在我怎樣才能在此堆棧面板的(每行之間即在列表中)的端

回答

1

你必須做的是,在StackPanel的內添加您的當前數據,然後添加路徑在以前的答案和地方提到這兩個在一個堆疊面板內與取向=水平

0
畫一條線

在你StackPanel中的所有其他下方,應用此:

<Path Data="M0,0 L1,1 M0,1 L1,0" Stretch="Uniform" Stroke="Red" /> 
相關問題