2

I need to know whether the Storyboard is begun or not. If it is begun, I need to stop, otherwise I no need to stop. Both begin and stop will be done in code behind.

Currently I've done this:

if (parameter != null && parameter is System.Windows.Media.Animation.Storyboard)
{
    if (!(bool)value)
    {
        (parameter as System.Windows.Media.Animation.Storyboard).Begin();
        return Visibility.Visible;
    }
    else
    {
        (parameter as System.Windows.Media.Animation.Storyboard).Stop();
        return Visibility.Collapsed;
    }
}

I have faced the binding error:

System.Windows.Media.Animation Warning: 6 : Unable to perform action because the specified Storyboard was never applied to this object for interactive control.; Action='Stop'; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='7861304'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; TargetElement='System.Windows.Media.Animation.Storyboard'; TargetElement.HashCode='7861304'; TargetElement.Type='System.Windows.Media.Animation.Storyboard'

Can anyone share how to stop the storyboard once its begun?

torvin
  • 6,515
  • 1
  • 37
  • 52
Elavarasan M
  • 182
  • 1
  • 11
  • Is this a part of a converter? What is `value`? Show some more code. Also read this: https://msdn.microsoft.com/en-us/library/ms741997%28v=vs.100%29.aspx – torvin Sep 23 '15 at 23:01
  • value is boolean, yes its a converter. what i want is need to skip the stop operation if it is called before Begin (). please help me. – Elavarasan M Sep 28 '15 at 04:21
  • I need to stop the storyboard once it is start only, otherwise i need to skip the Stop operation. any suggestion on this ? – Elavarasan M Mar 28 '16 at 19:28

0 Answers0