سؤال

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