问题
Does anyone have a working WPF4 version of the DataStateSwitchBehavior? This was part of the Expression Blend Samples for Siverlight at: http://expressionblend.codeplex.com/wikipage?title=Behaviors%20and%20Effects&referringTitle=Documentation
Thanks!
回答1:
If you download the source from the codeplex link that you mentioned, it also includes source for WPF. It is version 3.5, but that shouldn't be a huge deal.
If you only want the DataStateSwitchBehavior, you can start a new project, add the source files :
BindingListener.cs ConverterHelper.cs DataStateSwitchBehavior.cs GoToState.cs
and add a reference to the Blend dlls. It compiles and works.
回答2:
Not sure if DataStateSwitchBehavior for WPF4 specifically will work with it, but there's an updated version on CodePlex submitted by a user: http://expressionblend.codeplex.com/workitem/8148
See this blog post for more info (basically in SL4's case it was a binding workaround which neither work nor is needed now): http://blog.thekieners.com/2010/11/09/expression-blend-samples-not-working-with-silverlight-4-and-wpf-4/
来源:https://stackoverflow.com/questions/3955516/anyone-have-a-datastateswitchbehavior-for-wpf4