I’ve created a TriggerBase class, name CollectionContainsValueTrigger. As its name suggests, the trigger invokes the action whenever it contains a certain value.
However, I would like to create the trigger so it acts in such a way that it accepts all kinds of ObservableCollection of T, not just an explicit typed of ObservableCollection. I tried ObservableCollection of object but the binding doesn’t work because the Type is different from my ViewModel‘s explicitly typed ObservableCollection.
How can I do this?
xaml example:
<i:Interaction.Triggers>
<mi:CollectionContainsValueTrigger Collection="{Binding SomeStronglyTypedViewModelCollection}" Value="Some Value">
<SomeAction />
</mi:CollectionContainsValueTrigger>
</i:Interaction.Triggers>
ok i realized that xaml does not support Generics currently, only in the future version. if it does, it would have solved my problem….