c# - Stopping a programmatically instantiated storyboard -


I have an event trigger that will stop some storyboards which are defined in my XML ... but now I have a storyboard That I am starting the program.

  & lt; UserControl.Resources & gt; & Lt; Storyboard x: key = "fadein" & gt; ... Definition in feed & lt; / StoryBoard & gt; & Lt; Storyboard x: key = "fadeout" & gt; ... Definition in feed & lt; / StoryBoard & gt; & Lt; / UserControl & gt; & Lt; UserControl.Triggers & gt; & Lt; Event Trigger Routing Avent = "Mouse. Mouse Lev" & gt; & Lt; StartStoreboard = "{Static Resources Fadein}" X: Name = "FadeinBAG Storyboard" /> & Lt; / EventTrigger & gt; & Lt; EventTrigger Routing Avent = "Mouse.Messenger" & gt; & Lt; StopStoryboard StartStoreboardNameName = "FadeIn_BeginStoryboard" / & gt; & Lt; Start StopStoryboard StoryboardName = "FadeOut_BeginStoryboard" /> & Lt; / EventTrigger & gt; & Lt; /UserControl.Triggers> Storyboard FadeOutStoryboard; Public Zero StopFadeOut () {FadeIn_BeginStoryboard.Storyboard.Stop (); FadeOut_BeginStoryboard.Storyboard.Stop (); FadeOutStoryboard = (Storyboard) FindResource ("FadeOut"); FadeOutStoryboard.Name = "FadeOutStoryboard"; FadeOutStoryboard.Begin (); }  

When I did a & lt; StartStopStoryboardStoryboardName = "FadeOutStoryboard" /> It tells me that this FadeOutStoryboard can not be found, I'm quite new to WPF programming, so this could be a better way of doing it and I'm open to it by parents (StoppadAut) The method is being used which makes an example of my user control.

You need to run the lines for the creator only once.

  FadeOutStoryboard = (Storyboard) FindResource ("FadeOut"); FadeOutStoryboard.Name = "FadeOutStoryboard";  

Then add this row to the right after them.

  RegisterName ("FadeOutboardboard", FadeOutboardboard);  

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -