Have multitrigger, one of the conditions is not null, so if StowedAssetDetailedThumbnailViewModel != null then set template
<Style.Triggers> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="IsSelected" Value="true" /> <Condition Binding="{Binding Path=StowedAssetDetailedThumbnailViewModel, Converter={StaticResource isNull}}" Value="False"/> </MultiTrigger.Conditions> <Setter Property="Template" Value="{StaticResource SelectedTemplate}" /> </MultiTrigger> </Style.Triggers>
Using simple converter:
return isNull == null;
the error is Must have non-null value for Property
UPDATE: Thanks, the final solution is
<Style.Triggers> <MultiDataTrigger> <MultiDataTrigger.Conditions> <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true" /> <Condition Binding="{Binding Path=StowedAssetDetailedThumbnailViewModel, Converter={StaticResource isNull}}" Value="false"/> </MultiDataTrigger.Conditions> <Setter Property="Template" Value="{StaticResource SelectedTemplate}" /> </MultiDataTrigger> </Style.Triggers>
You'll want to use a MultiDataTrigger in this case. A MultiTrigger can only be triggered by dependency properties.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With