Reputation: 29
I am developing my own FTP client and I want to create a nice GUI using expression blend. I was wondering how to create a custom event so that I can trigger an animation when an upload completes. In other words, is there a way I can subscribe to an even in expression blend/ create my own event? Thanks for the help.
Upvotes: 1
Views: 327
Reputation: 12550
Just put a new public
property called bool DownloadCompleted { get; set; }
in your ViewModel, and then use a ControlStoryboardAction
with a DataTrigger
to watch for a change in the DownloadCompleted
property to true
... the animation will then be started.
There's a good explanation how to do it here.
http://www.basarat.com/2011/05/expression-blend-starting-storyboard.html
http://www.silverlightbuzz.com/2009/10/12/animating-with-storyboards-in-blend/
There's no need to create your own Event to notify of the completed download, however, you can do that if you wish...just choose an EventTrigger
instead...and point the SourceName
to the named element that's in your XAML that either has the event raised on it or (if it's a bubbling event, then you have the flexibility of watching the event on other elements....as long as the event bubbles through them).
Upvotes: 1