我正在使用 Windows Phone 7 应用程序,它在 HyperlinkButton 中加载图像。这很好用,除了Stretch="Uniform"
在图像不是完全正方形时会在图像周围放置空白区域。有没有办法让这个透明?
<HyperlinkButton NavigateUri="{Binding Id, StringFormat='{}/x;component/Pages/FullScreenImage.xaml?id={0}'}"
Grid.Column="0" Grid.Row="0"
toolkit:TiltEffect.IsTiltEnabled="True" Background="Transparent">
<HyperlinkButton.Template>
<ControlTemplate TargetType="HyperlinkButton">
<Grid Margin="0,0,0,10" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Grid.Column="0"
Grid.Row="0"
Text="Advertised"
Margin="10,0,0,0"
Style="{StaticResource PhoneTextSubtleStyle}" />
<Image Grid.Column="0"
Grid.Row="1"
Margin="0"
Stretch="Uniform"
Source="{Binding ExpectedImage}" />
</Grid>
</ControlTemplate>
</HyperlinkButton.Template>
</HyperlinkButton>