Question

I have a list saved in the ObjectInstance of the ObjectDataProvider class. When calling my datatrigger i would like to run a predicate on the list and return a value true/false so i can hide/show text. Ideally i would like to call a property "Noresults" that would return true/false so i can toggle text in the view.

<DataTrigger Binding="{Binding Path=ObjectDataProvider.NoResults, Mode=OneWay,Source={StaticResource DongleContentsProvider}, BindsDirectlyToSource=True}" Value="true">
    <Setter TargetName="NoResults" Property="Visibility" Value="Visible" />
</DataTrigger>
Was it helpful?

Solution

Add a Binding.Converter which does run any logic and returns a respective bool.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top