I searched everything and can not find the answer to this question. My application lives in a world of free XAML, so I have to rely on XamlReaders and the tree to find the elements. I have a component that handles the rendering of these XAML pages. This renderer must know the status of the storyboard, which can run on loaded XAML. So, what I would like to do in my renderer is something like this: -
var resources = _currentScreenFrameworkElement.Resources;
foreach (var item in resources.Values)
{
if (item is Storyboard)
{
try
{
var storyboard = item as Storyboard;
**if (storyboard.GetCurrentState() == ClockState.Active)**
All is well and good. However, the problem is that when I try to execute dcheck, CurrentState throws an exception: -
"Cannot perform action because the specified Storyboard was not applied to this object for interactive control."
Looking around, I see this because I need to make a guided storyboard. So my question is: how to do this in XAML? I do not run the storyboard in the code, so I can not go to the overloaded BeginStoryboard.