I have a ListBox in Silverlight that has a list of items inside. Each item has a certain number of additional options, the availability of which depends on the each item.
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Name}" />
<Button HorizontalAlignment="Right" x:Name="editDiarySecurityButton">
<Image Source="/xxx.yyy.Silverlight.Common;Component/Resources/Images/Icons/Ribbon/Small/editSecurity.png" Width="16" Height="16" />
</Button>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
The Button editDiarySecurityButton should be handled according to whether that item (representing a Diary) has Security applied to it, or not. I would probably just modify the opacity of the image to reflect this.
My question is how can I achieve this? In ASP.NET, I'd have attached to the ItemDataItemBound event, but I don't think this is available in WPF/Silverlight.