【发布时间】:2018-12-18 23:34:07
【问题描述】:
所以我有这个Storyboard:
<Storyboard x:Key="animate">
<DoubleAnimation BeginTime="0:0:0" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="0:0:2.0"/>
</Storyboard>
我的绑定value:
public bool IsFound
{
get { return _isFound; }
set
{
_isFound= value;
NotifyPropertyChanged();
}
}
还有我的Grid 得到这个Storyboard:
<Grid name="myGrid">
....
<Grid>
if(IsFound)
{
Storyboard storyboard = Resources["animate"] as Storyboard;
if (storyboard != null)
storyboard.Begin(myGrid);
}
所以我正在寻找纯粹的XAML,而不是在后面的代码中检查这个IsFound。
【问题讨论】:
标签: wpf storyboard