I used to use a custom Blend behavior to bind an enum on the ViewModel to VisualState
's that were named the same as the enum enumerations.
However after including references and then including the using
s, it seems the Bahaviors SDK is not currently supported.
What is the current best way to change VisualState in a MVVM way in a Windows 10 Universal App?
"Behavior SDK" can be included by right-clicking on References -> Add Reference -> Universal Windows -> Extensions -> Behavior SDK.
Some of the APIs have been changed, so
Behavior<T>
is not there to inherit from (useDependencyObject, IBehavior
instead and implement theIBehavior
interface). AlsoVisualStateUtilities.TryFindNearestStatefulControl
is nowVisualStateUtilities.FindNearestStatefulControl
. When I imported my old behaviors and couldn't resolve the references even with the Behavior SDK referenced, it made me think that the imports had not worked (especially since there is a warning about importing the Behavior SDK which claims it might not work - the link to find out more information is dead which hardly inspired confidence!).