public static Storyboard CreateStoryboard(Control resourceHolder, string resourceName) { ContentControl c = new ContentControl() { Template = (ControlTemplate)resourceHolder.Resources[resourceName] }; c.ApplyTemplate(); StoryboardContainer container = (StoryboardContainer)VisualTreeHelper.GetChild(c, 0); return(container.Storyboard); }
Storyboard GetStoryboard(string resourceKey) { return(StoryboardContainer.CreateStoryboard(module, resourceKey)); }