C# 情节提要可以执行自定义功能吗?

C# 情节提要可以执行自定义功能吗?,c#,wpf,C#,Wpf,情节提要的常见用途是在不同的开始时间执行多个动画,即: Storyboard m_storyboard = new Storyboard(); var fadeInAnimation = new DoubleAnimation(1d, TimeSpan.FromSeconds(3)); fadeInAnimation.BeginTime = TimeSpan.FromSeconds(1); Storyboard.SetTarget(fadeInAnimation, grid); Storybo

情节提要
的常见用途是在不同的
开始时间
执行多个动画,即:

Storyboard m_storyboard = new Storyboard();

var fadeInAnimation = new DoubleAnimation(1d, TimeSpan.FromSeconds(3));
fadeInAnimation.BeginTime = TimeSpan.FromSeconds(1);
Storyboard.SetTarget(fadeInAnimation, grid);
Storyboard.SetTargetProperty(fadeInAnimation, new PropertyPath(Grid.OpacityProperty));
m_storyboard.Children.Add(fadeInAnimation);

var fadeOutAnimation = new DoubleAnimation(1d, TimeSpan.FromSeconds(3));
fadeOutAnimation.BeginTime = TimeSpan.FromSeconds(1);
Storyboard.SetTarget(fadeOutAnimation, label);
Storyboard.SetTargetProperty(fadeOutAnimation, new PropertyPath(Label.OpacityProperty));
m_storyboard.Children.Add(fadeOutAnimation);

m_storyboard.Begin();
但是我想设置
情节提要
,这样它就可以在指定的
起始时间
调用我的自定义函数了-可以吗

public void CustomFunction()
{
    // do something
}

你可能想看看。据我从文档中了解,建议的方法都与动画相关。相反,我希望在
情节提要
的运行时间达到指定的
开始时间
时对函数进行“一次性”调用。