本文整理汇总了C#中System.Windows.Media.Animation.Storyboard.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# Storyboard.Clone方法的具体用法?C# Storyboard.Clone怎么用?C# Storyboard.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Media.Animation.Storyboard
的用法示例。
在下文中一共展示了Storyboard.Clone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnApplyTemplate
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
ContentPresentationSite = GetTemplateChild(ContentPresentationSiteName) as ContentPresenter;
StoryboardLeftIn = FindResource(ContentLeftInName) as Storyboard;
if (StoryboardLeftIn != null)
{
if (StoryboardLeftIn.IsFrozen)
{
StoryboardLeftIn = StoryboardLeftIn.Clone();
StoryboardLeftIn.Completed += OnTransitionCompleted;
}
}
StoryboardLeftOut = FindResource(ContentLeftOutName) as Storyboard;
if (StoryboardLeftOut != null)
{
if (StoryboardLeftOut.IsFrozen)
{
StoryboardLeftOut = StoryboardLeftOut.Clone();
StoryboardLeftOut.Completed += OnTransitionCompleted;
}
}
StoryboardRightIn = FindResource(ContentRightInName) as Storyboard;
if (StoryboardRightIn != null)
{
if (StoryboardRightIn.IsFrozen)
{
StoryboardRightIn = StoryboardRightIn.Clone();
StoryboardRightIn.Completed += OnTransitionCompleted;
}
}
StoryboardRightOut = FindResource(ContentRightOutName) as Storyboard;
if (StoryboardRightOut != null)
{
if (StoryboardRightOut.IsFrozen)
{
StoryboardRightOut = StoryboardRightOut.Clone();
StoryboardRightOut.Completed += OnTransitionCompleted;
}
}
if (ContentPresentationSite != null)
{
ContentPresentationSite.Content = Content;
}
//VisualStateManager.GoToState(this, NormalName, true);
}
示例2: WireUpStoryboard
/// <summary>
/// We have to use a clone to enable wiring up a method to the completed event
/// otherwise the isfrozen state of the storyboard stays true and the method
/// to the completed event can't be attached (exception thrown)
/// </summary>
/// <param name="storyboard"></param>
private void WireUpStoryboard(Storyboard storyboard)
{
storyboard = storyboard.Clone();
storyboard.Begin(this);
storyboard.Completed += MainWindowStoryboardCompleted;
}