I have templated a ListBox, and I'm having trouble getting the Action to work.
Here's a rough example of how it's templated.
Here's a rough example of how it's templated.
<ListBox.ItemTemplate>
<DataTemplate>
<ToggleButton IsChecked="{Binding Path=Enabled}"
cal:Message.Attach="FilterEnable($dataContext)">
<Image Source="{Binding Path=ImagePath}"/>
</ToggleButton>
</DataTemplate>
</ListBox.ItemTemplate>
Using Snoop, I can see that ListBoxItem.IsSelected=true
, but I think what's going on is that I'm not actioning on the ToggleButton
, but instead, up the visual tree on just the ListBoxItem
. Should I forgo the ToggleButton
and throw Message.Attach on the ItemContainerStyle
setter?