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>
有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top