Quantcast
Channel: Blinking Button Animation
Viewing all articles
Browse latest Browse all 7

Blinking Button Animation

$
0
0

Do not try to stop the storyboard on a click trigger, you can just rely on the Trigger exit actions to do all the work. 

In your click handler "btnSave_Click", simply change DataChanged back to false.

Your button will disable, and the exit action will trigger on the existing DataTrigger.

I presume your DataChanged property implements INotifyPropertyChanged, which updates the bindings and triggers.

Also, button clicks are events off of the UI layer. Sometimes you have to ensure you are back on the UI layer first, for binding to register changes from the click handler:

    Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() =>
        {
            DataChanged = false;
        }));

(this is assuming the PropertyChanged event is triggered when you change the property)

I hope this answers you second question too. If so, please mark both as such.

Kind regards,
Pete


#PEJL




Viewing all articles
Browse latest Browse all 7

Trending Articles



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