2012-03-21 4 views
1
<ListBox Margin="0,2,0,0" SelectionChanged="OnSelectionChanged" ScrollViewer.VerticalScrollBarVisibility="Disabled" x:Name="lstUcpPanel" ItemContainerStyle="{StaticResource myContainerStyle}"> 


      <ListBox.ItemsPanel> 
       <ItemsPanelTemplate> 
        <toolkit:WrapPanel Width="Auto" Height="Auto" Margin="-7,-8,-7,0" ItemWidth="246" /> 
       </ItemsPanelTemplate> 
      </ListBox.ItemsPanel> 


      <ListBox.ItemTemplate> 
       <DataTemplate> 
        <Border BorderThickness="1" Margin="3.5,1,0,0" BorderBrush="Transparent"> 
         <StackPanel Orientation="Vertical" Background="LightGray"> 
          <Image Height="115" Width="115" Margin="2" Source="{Binding categoryImageName}" ></Image> 
          <TextBlock Text="{Binding name}" TextWrapping="Wrap" Foreground="Black" HorizontalAlignment="Center"></TextBlock> 
         </StackPanel> 

        </Border> 

       </DataTemplate> 
      </ListBox.ItemTemplate> 
     </ListBox> 

に応じてUIを変更しますfdsaflksdj flhasdjhfl ASD」、そしてデザインは次のように次のようになります。テキストWP7の寸法形式を以下のようにIは、データを表示するため、上記のコードを使用してい

this is distorted format

私が知りたいことがanywaがあるありますアイテムの均一な高さで歪みのない均一なフォーマットでアイテムを表示できます。

答えて

1

は= WrapPanelで固定高さのアイテムを与えることについてどのように

<Image Height="115" Width="115" Margin="2" Source="{Binding categoryImageName}" Stretch="Fill" ></Image> 
+0

すみませんでした。ここの問題は画像ではありません。問題はアイテムの高さにあります。私はそれぞれのアイテムの高さの均一性をしたい –

1

を「塗りつぶし」ストレッチするためにあなたのイメージのストレッチプロパティを設定しますか?

<toolkit:WrapPanel ItemHeight="80" ... /> 
+0

私はそれを試みたが、これはアイテムの完全なテキストを表示されません。 –

+0

指定した高さは何ですか? – Jessica

+0

関連する問題