0
我已經爲我的圖標創建了淡出動畫,但是當動畫完成時圖標又回到了alpha 0.我怎樣才能讓他留在1?完成後WPF淡入動畫消失
var a = new DoubleAnimation
{
From = 0.0,
To = 1.0,
FillBehavior = FillBehavior.Stop,
Duration = new Duration(TimeSpan.FromSeconds(1))
};
var storyboard = new Storyboard();
storyboard.Children.Add(a);
Storyboard.SetTarget(a, IconGlass);
Storyboard.SetTargetProperty(a, new PropertyPath(OpacityProperty));
storyboard.Begin();
}
XAML:
<StackPanel Name="IconGlass" Orientation="Horizontal" Margin="0,0,0,39" Opacity="0">
你覺得'FillBehavior.Stop'是什麼意思? –
謝謝,請張貼它作爲答案 – Dim