我正在使用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>
答案 0 :(得分:0)
我的图片来源正在创建白色。 : - /