Quantcast
Channel: Caliburn.Micro: Xaml Made Easy
Viewing all articles
Browse latest Browse all 1760

New Post: Message.Action in ListBox?

$
0
0
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.
<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?

Viewing all articles
Browse latest Browse all 1760

Trending Articles