2014-10-25 4 views
1

항목 사이에 공간이 있으며 제거 할 수 없습니다. 나는 ItemsControl에 대해 하루 종일 인터넷 검색을 해왔으며 아무 것도 발견하지 못했습니다. 또한 listbox에서도 작동하지 않았습니다. 심지어 악화 시켰습니다.ItemsControl에 항목 사이에 공간이 있습니다.

누구나 아이디어가 있습니까?

   <ItemsControl BorderThickness="0" ItemsSource="{Binding Items}" VerticalAlignment="Stretch" VerticalContentAlignment="Stretch"> 
       <ItemsControl.ItemContainerStyle> 
        <Style> 
         <Setter Property="FrameworkElement.Margin" Value="0,0,0,0"/> 
        </Style> 
       </ItemsControl.ItemContainerStyle> 
       <ItemsControl.ItemTemplate> 
        <DataTemplate DataType="{x:Type newsSubscriber:Item}"> 
         <Border VerticalAlignment="Stretch" SnapsToDevicePixels="True" BorderThickness="0"> 
          <Border.Background> 
           <ImageBrush Stretch="Fill" ImageSource="{Binding RepeatImagePath}"/> 
          </Border.Background> 
          <StackPanel Cursor="Hand" VerticalAlignment="Stretch"> 
           <StackPanel.InputBindings> 
            <MouseBinding MouseAction="LeftClick" Gesture="LeftClick" Command="{Binding GoToWebCommand}" /> 
           </StackPanel.InputBindings> 
           <StackPanel VerticalAlignment="Stretch" FlowDirection="RightToLeft" Height="{Binding hight}" Orientation="Horizontal" HorizontalAlignment="Right"> 
            <StackPanel.Background> 
             <ImageBrush Stretch="Fill" ImageSource="{Binding RepeatImagePath}"/> 
            </StackPanel.Background> 
            <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Width="70" Text="{Binding time}"/> 
            <TextBlock Language="he-il" TextWrapping="Wrap" HorizontalAlignment="Right" VerticalAlignment="Center" Width="300" Text="{Binding title}"/> 
            <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="38"> 
             <Image Stretch="None" Source="{Binding ArrowImagePath}"/> 
            </StackPanel> 
           </StackPanel> 
          </StackPanel> 
         </Border> 
        </DataTemplate> 
       </ItemsControl.ItemTemplate> 
      </ItemsControl> 

출력 그림 : output

+0

이미지를 게시하고 공백을 지적하면 도움이 될 수 있습니다. –

+0

가 추가되었습니다. 항목 사이의 작은 흰색을 참조하십시오. 그것의 웹 사이트 프로그램 뒤에. –

답변

0

당신은 아마 높이 = "{바인딩 높이}"속성 일부 큰 값으로 설정 한

여기 내 코드입니다.

<StackPanel VerticalAlignment="Stretch" 
      FlowDirection="RightToLeft" 
      Height="{Binding hight}" 
      Orientation="Horizontal" 
      HorizontalAlignment="Right"> 
+0

나는 그것을했다, 품목은 크게 얻었다 그러나 공간은 동일이다. 나는 내부 항목이 컨테이너와 더 관련 있다고 생각하지 않는다. –

0

올바른 트랙에서 FrameworkElement.Margin을 사용하는 위치 값 = "- 1"로 설정합니다. 공간을 제거하는 작은 겹침을 만듭니다.

<Setter Property="FrameworkElement.Margin" Value="-1"/>