Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Make start a storyboard on a event from ViewModel (MVVM)

$
0
0

I have a storyboard that should start anytime a certain event - from another object - is called.

So far, I solved using a trick like this

<DataTrigger Binding="{Binding IsUpdating}" Value="True"><DataTrigger.EnterActions><BeginStoryboard><Storyboard>
				 ...</Storyboard></BeginStoryboard></DataTrigger.EnterActions></DataTrigger>

When the event on my ViewModel is fired, I use this trick:

// event fired

App.Current.Dispatcher.BeginInvoke((Action)delegate()
{
	IsUpdating = false;
	IsUpdating = true;
});


Sure this code works, but this is not a very elegant way.

Any better solution to make the storyboard begin from the event ?




Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>