/// <inheritdoc /> /// <remarks> /// Creates <see cref="ActorView">scene nodes</see> for the actor children. /// </remarks> public override void Initialize() { base.Initialize(); foreach (Actor child in Actor.Children) { ActorView newChildView = (ActorView)Children.Add(child); newChildView.Parent = this; } }
/// <summary> /// Handles the ListChanged event of the children of the actor. /// Updates the actor children (child is added or removed). /// </summary> private void Children_ListChanged(object sender, ObservableListChangedEventArgs <Actor> e) { switch (e.ListChangedType) { case ObservableListChangedType.ItemAdded: ActorView addedActorView = (ActorView)Children.Add(e.Item); addedActorView.Parent = this; break; case ObservableListChangedType.ItemDeleted: Children.Remove(e.Item); break; } }