views:

59

answers:

1

I have a list of Parent objects that contain Children. Both Parents and Children have a Checked boolean property. These object are bound to an ItemsControl that displays the hierarchy.

I also have a "Show checked" checkbox that is one of my application settings that will determine the Visibility of the Items in the ItemsControl.

So based of (Parent.Checked or Child.Checked) && Checkbox.Checked I need to bind the result to the items.

Thanks in advance,

B

+1  A: 

Your ItemsControl should bind its ItemsSource to a CollectionViewSource with a filter. That filter will filter out unchecked items if "Show checked" checkbox is checked otherwise it will accept all.

The filter will use a bool property on the Parent class to determine if the parent or its children are checked.

Wallstreet Programmer