Thursday, 15 August 2013

Toggle ToggleButton's IsChecked on ListBox Selection

Toggle ToggleButton's IsChecked on ListBox Selection

I have a refresh button (a togglebutton) I would like to set to the
"Checked" state when an item has been selected in my listbox. (Listbox
selections are refreshed using my togglebutton.) The toggleButton is
successfully styled to turn blue when IsChecked is true.
What i've tried is variants of:
<ToggleButton x:Name=ShapeRefreshToggle />
<ListBox x:Name=ShapeListBox" Selector.IsSelected="False"
SelectedItem="{Binding SelectedShape, Mode=TwoWay,
UpdateSourceTrigger=PropertyChanged}"
<i:Interaction.Triggers>
<i:EventTrigger Selector.IsSelected="True">
<ei:GoToStateAction TargetName="connShapeRefreshToggle"
StateName="Checked"/>
</i:EventTrigger>
</i:Interaction.Triggers>
Can anyone see what I'm missing here? I am not getting any errors.
Thanks in advance!

No comments:

Post a Comment