I have a TextBlock bound to a property on my view model. I have a StoryBoard with fades the text in and out using the Opacity property. I am using this text to give the user feedback after they have performed an operation(success, error etc). How can I start the StoryBoard when the property changes from my view model? Is there a better way to do this sort of effect?
相关问题
- how to Enumerate local fonts in silverlight 4
- Free Silverlight mapping with Bing maps and OpenSt
- Custom number picker?
- Error using ResourceDictionary in Silverlight
- Can we create a Silverlight Socket Server ONLY usi
相关文章
- New Windows Application - What language?
- relative url in wcf service binding
- Embedded images not showing when in a UserControl
- Silverlight 4: How can I convert bmp byte array to
- Silverlight DataTemplate Memory Leak
- Silverlight - Paramterised resource values for Int
- RIA Authentication from a Web Services project
- Use TripleDESCryptoServiceProvider class in Silver
Sorry, I hate to tell it to you - but you're thinking about it wrong.
Don't think in storyboards, Opacity and Visiblity properties. Always think "Visual States".
What you just described (fading in a TextBlock in response to some business logic change) is a perfect case for using VisualStateManager states.
Basically you'll end up having a "Is" state group that'll have one state for when the condition is met (some state has been achieved) and another for when it's not met.
I strongly suggest you spend 30 minutes watching these excellent Blend VSM tutorial videos. http://expression.microsoft.com/en-ca/cc643423.aspx Specifically the 7 minutes video under "Add States to a Control".
Erwin van dar valk just published an excellent article demoing how to change VSM states from MVVM that's Pertinent to your situation. http://blogs.msdn.com/erwinvandervalk/archive/2009/10/12/how-to-work-with-animations-in-silverlight-in-the-mvvm-pattern.aspx