views:

206

answers:

0

I have a listbox which has a datatemplate. Within the template I've got a trigger to hide a lsitboxitem if it's IsDeleted property is set to true.

<DataTrigger Binding="{Binding Path=IsDeleted}" Value="True">
  <Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>

This work OK but the problem I have is that the listbox itself doesn't redraw when a listboxitem is collapsed. If I had 2 items in the listbox and I delete one, the listbox height stays the same but there is only 1 item visible.

I thought this would be a InotifyPropertyChanged issue but I am setting that when I set the listbox item to IsDeleted = True.

Any ideas? Thanks.