Ignoring unsupported property 'Visibility'
Posted: 20 Jan 2016, 19:23
Inside a DataTemplate of a ListBoxItem I am trying to set DataTrigger but I am getting the warning " Ignoring unsupported property 'Visibility' ". It also happens whit the Text property of a TextBlock.
Here is part of the code
Am I doing something wrong or this behaviour is not allowed?
Thank you
Here is part of the code
Code: Select all
<ListBox.ItemTemplate>
<DataTemplate>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsSelected}" Value="True">
<Setter TargetName="RevisionsList" Property="Visibility" Value="Visible" />
</DataTrigger>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsSelected}" Value="False">
<Setter TargetName="RevisionsList" Property="Visibility" Value="Collapsed" />
</DataTrigger>
</DataTemplate.Triggers>
Thank you