in src/BehaviorsSDKManaged/Microsoft.Xaml.Interactions/Media/ControlStoryboardAction.cs [72:129]
public object Execute(object sender, object parameter)
{
if (this.Storyboard == null)
{
return false;
}
switch (this.ControlStoryboardOption)
{
case ControlStoryboardOption.Play:
this.Storyboard.Begin();
break;
case ControlStoryboardOption.Stop:
this.Storyboard.Stop();
break;
case ControlStoryboardOption.TogglePlayPause:
{
ClockState currentState = this.Storyboard.GetCurrentState();
if (currentState == ClockState.Stopped)
{
this._isPaused = false;
this.Storyboard.Begin();
}
else if (this._isPaused)
{
this._isPaused = false;
this.Storyboard.Resume();
}
else
{
this._isPaused = true;
this.Storyboard.Pause();
}
}
break;
case ControlStoryboardOption.Pause:
this.Storyboard.Pause();
break;
case ControlStoryboardOption.Resume:
this.Storyboard.Resume();
break;
case ControlStoryboardOption.SkipToFill:
this.Storyboard.SkipToFill();
break;
default:
return false;
}
return true;
}