グリッドと自分のページを使用しています。ページは、角氷トレイのように均等に分割する必要があります。
各グリッド列には画像が含まれています。
3つの等しい部分に分割するために、私はこのコードを使用しています:
<ListBox SelectionChanged="listBox1_SelectionChanged" HorizontalContentAlignment="Stretch" Height="720" HorizontalAlignment="Left" Margin="1,5,0,0" Name="listBox1" VerticalAlignment="Top">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<toolkit:WrapPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid HorizontalAlignment="Center" VerticalAlignment="Top" Margin="3" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<Border CornerRadius="6" BorderBrush="Gray" BorderThickness="2" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" x:Name="border1">
<toolkit:WrapPanel x:Name="wp">
<Image Source="{Binding ImagePicture}" Margin="0,10,0,0" Height="110" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Margin="0,0,0,5" TextAlignment="Center" Text="{Binding categoryname}" Foreground="Black" FontStyle="Normal" Height="Auto" Width="140" HorizontalAlignment="Center" VerticalAlignment="Stretch"/>
</toolkit:WrapPanel>
</Border>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
今これを使うと、時々画像が小さいので、私が示したこの問題に直面します。
これは私が欲しいものです:
これが私の問題です:
この問題の解決策を教えてください。