wpf - How to connect ICommand and VisualStateManager together -
how can let controls on window know states should changed. have use icommand , since controls can have different states (enable/disable , checked/unchecked ...) have handle them visualstatemanager.
this possible scenario: when record button clicked(checked) other controls in window should uncheckable , once recording finished should checkable , many other scenarios.
any appreciated. thanks.
you can achieve of interaction , interactivity. see if helps.
add below references in xaml
xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
you can bind icommand
, provide visualstate
name applied when button
clicked
<button> <i:interaction.triggers> <i:eventtrigger eventname="click"> <i:invokecommandaction command="{binding youricommand}" /> <ei:gotostateaction statename="yourvisualstatename" /> </i:eventtrigger> </i:interaction.triggers> </button>
if don't have blend 4, can install blend 4 sdk current behavior assemblies.
Comments
Post a Comment