Storyboards can’t find ControlTemplate elements

Finally found it. When you call Begin on storyboards that reference elements in the ControlTemplate, you must pass in the control template as well.

Changing:

pressedButtonStoryboard.Begin(_xamlButton);

To:

pressedButtonStoryboard.Begin(_xamlButton, _xamlButton.Template);

Fixed everything.

Leave a Comment