wpf - Making a generic loading animation in mvvm -
I have an MVVM app that retrieves lots of data from the remote server. I want to add an animation, while data loading What is his best way of doing that?
One way is a property in a visual model named ISLoadingData, after which you can use it by using the BooleanTwizibility Connor animation Host can control the visibility of the control property.
Visibility = {binding path = isodding data, converter = {static resource boolean tuVisibility corp}}
ControlTemplate for starting the storyboard with this control animation , When the visibility property is set to True.
& lt; ControlTemplate.Triggers & gt; & Lt; Trigger Property = "Equible" value = "True" & gt; & Lt; Trigger.EnterActions & gt; & Lt; StartStoreboard x: Name = "Storyboard 0" Storyboard = "{Static Resource Animation}" /> & Lt; /Trigger.EnterActions> & Lt; / Catalyst & gt; & Lt; /ControlTemplate.Triggers>
For a sample of this animation please see me full source.
Comments
Post a Comment