Hi,
I would like to know how to hide a node based on a binding. I looked all over for it but was unable to find any examples on how to do this.
Thanks!
-Brian
Actually that would work fine for me. I have two XamDataTrees based on the same model and both trees need to hide SOME of the nodes in the model. I've tried to implement this with the following property:
Visibility="{Binding ElementName=ActualVisibility}"
The property "ActualVisibility" on the model has a get that determines what the visibility for the node should be. I tried using NodeExpansionChanging instead of NodeExpansionChanged but this does me no good. All nodes are visible on both models :(
The Visibility property of the Node Control will just make it unvisible, but the tree will still have information about that node and try to use it, e.g. when you are navigating with the keyboard, that node will still be selected / activated. So, this will probably not work for you.
Regards,
Hi Stoimen,
I don't want to remove the underlying data though. I did find something that I think is what I am looking for. I am looking into using the Node's Control property's Visibility property to show and collapse the node. Does this make sense?
Thanks again,
Binding the XamDataTree to a data source makes it reflect exactly the data source, so if you would like to hide certain node, you would have to remove the corresponding item in the data source.
HTH,