An object from an external resource

I have a StoryBoard in an external ResourceDictionary . I can get this storyboard successfully, but I can not sign the Completed event

I got an InvalidOperationException :

The specified value of type 'System.Windows.Media.Animation.Storyboard' should be set to IsFrozen equal to false to change.

+4
source share
1 answer

You must create a StoryBoard clone and modify this instance.

 Storyboard storyboard = FindResource...Clone(); storyboard.Completed += handler... 

You can also call Freeze if you use the Freezable template; however, once you call Freeze , you cannot return the IsFrozen state back to false.

+6
source

Source: https://habr.com/ru/post/1343652/


All Articles