I have a template for a ListBox. In the ListBox I have a template on the ListBoxItems. I want to disable some of these items (I am still working on what I want to use to make the "event" fire, so I have just put in IsSelected for now)
My issue is that I need to get at some of the data for the ListBoxItem to know if it should be disabled or not (ie, which one are we looking at right now...)
I thought I would use ConverterProperty, but it seems to only allow Resources and hard coded values (I can't databind with out reflection, which I don't want to do).
I tried to pass in RelativeSource Self and the ConverterParameter and that just passed in an object of type RelativeSource that would not cast to ListBoxItem.
Any ideas?
<Style x:Key="CheckBoxListStyle" TargetType="ListBox">
<Style.Resources>
<Style TargetType="ListBoxItem">
<Style.Triggers>
<DataTrigger Binding="{Binding IsSelected,
RelativeSource={RelativeSource Self},
Converter={StaticResource DisableWorkItemConverter},
ConverterParameter={RelativeSource Self}}" Value="True">
<Setter Property="IsEnabled" Value="False"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Style.Resources>
</Style>