【发布时间】:2014-12-06 19:43:57
【问题描述】:
我已阅读How can I make an Image grow in size (give the illusion of selection) through a WPF animation? 并尝试使用DoubleAnimation 更改图像的高度,但它不起作用。
<Image Name="image" Height="100" Source="http://www.online-image-editor.com/styles/2013/images/example_image.png" Stretch="None">
<Image.Resources>
<Storyboard x:Name="show">
<DoubleAnimation
Storyboard.TargetName="image"
Storyboard.TargetProperty="Height"
From="100" To="400" Duration="0:0:1"
/>
</Storyboard>
</Image.Resources>
</Image>
<Button Content="image stretch" Click="button_clicked" />
这是button_clicked 函数:
private void button_clicked(object sender, RoutedEventArgs e)
{
show.Begin();
}
[编辑]:因为 Johan Falk 的回答,我用 Windows Phone Silverlight 工具包尝试了上面的代码,它可以工作。所以解决方案是使用 Windows Phone Silverlight。
【问题讨论】:
标签: c# xaml windows-phone windows-phone-8.1