public InspectTreeNode3D(InspectTreeNode node, InspectTreeState state) { void NodePropertyChanged(object sender, PropertyChangedEventArgs args) { var senderNode = sender as InspectTreeNode; switch (args.PropertyName) { case nameof(InspectTreeNode.Children): break; case nameof(InspectTreeNode.IsSelected): case nameof(InspectTreeNode.IsMouseOver): UpdateMaterial(); break; case nameof(InspectTreeNode.IsExpanded): foreach (var child in Children.OfType <InspectTreeNode3D> ()) { child.IsFlattened = !senderNode.IsExpanded; } break; } } Node = node; node.PropertyChanged += NodePropertyChanged; childIndex = state.AddChild(node.View); }
public InspectViewNode(InspectTreeNode node, InspectTreeState state) { Node = node; node.PropertyChanged += NodePropertyChanged; this.childIndex = state.AddChild(node.View); }