Associating VisualState with ViewModel in Windows 10 Generic Applications

I used the usual Blend behavior to bind enums in the ViewModel to VisualState , which were named the same as enumerations.

However, after including links and then turning on using s, it seems the Bahaviors SDK is not currently supported.

What is the best way to change VisualState in an MVVM method in a generic Windows 10 application?

0
windows-10 mvvm win-universal-app visualstatemanager
source share
1 answer

You can enable SDK Behavior by right-clicking the Links link → Add Link → Universal Windows → Extensions → SDK Behavior.

Some of the APIs have been changed, so Behavior<T> does not exist for inheritance (use DependencyObject, IBehavior instead and implement the IBehavior interface). Also VisualStateUtilities.TryFindNearestStatefulControl now VisualStateUtilities.FindNearestStatefulControl . When I imported my old behavior and was unable to resolve links even with a link to the Behavior SDK, it made me think that the import did not work (especially since there is a warning about importing the Behavior SDK, which claims that it may not work - link to to find out more information is dead, which is unlikely to inspire confidence!).

0
source share

All Articles