Example #1
0
 /// <summary>
 /// Constructor that specifies of the children collection
 /// will be observed for changes.
 /// </summary>
 /// <param name="childenObservable">
 /// If true, changes in the children collection will be observed and
 /// associated logic will be triggered. If false, the collection's changes
 /// will not be observed.
 /// </param>
 public Item(bool childenObservable)
 {
     if (childenObservable)
     {
         // This updates the Parent properties
         // of all children added to this Item.
         Children.CollectionChanged += (sender, e) => ItemEventHandlers.CollectionChanged(sender, e, this);
     }
 }
Example #2
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 public Workspace()
 {
     // This updates the parent property of each
     // new child to be null because this is the root.
     Items.CollectionChanged += (sender, e) => ItemEventHandlers.CollectionChanged(sender, e, null);
 }