title: DiagramListener not being called?
body: <p>I am trying to capture TreeExpanded and TreeCollapsed events, but the respective listeners are not being called. I have implemented the listeners as follows:</p>
  
  <pre><code>  myDiagram.addDiagramListener("TreeExpanded", function(e) {
      console.log("&gt;&gt;&gt;&gt;&gt; STUFF HAPPENED in TreeExpanded");
  
    });
  
    myDiagram.addDiagramListener("TreeCollapsed", function(e) {
      console.log("&gt;&gt;&gt;&gt;&gt; STUFF HAPPENED in TreeCollapsed");
    });
  </code></pre>
  
  <p>The full code for myDiagram looks like this:</p>
  
  <pre><code>  myDiagram = $(go.Diagram, "myDiagramDiv",
      {
        "undoManager.isEnabled": true,
        layout: $(go.TreeLayout),
        "ChangedSelection": onSelectionChanged
      });
  
    function geoFunc(geoname) {
      var geo = icons[geoname];
      if (geo === undefined) geo = icons["heart"];  // use this for an unknown icon name
      if (typeof geo === "string") {
        geo = icons[geoname] = go.Geometry.parse(geo, true);  // fill each geometry
      }
      return geo;
    }
  
    myDiagram.nodeTemplate =
      $(go.Node, "Auto",
        {isTreeExpanded:false},
        {doubleClick: function(e, node) {node.expandTree(1);}},
        $(go.Shape, "Rectangle",
          { strokeWidth: 2, stroke: colors["gray"],  },
          new go.Binding("fill", "color")),
        $(go.TextBlock, {stroke:"black",font:"12pt sans-serif",margin:3,wrap: go.TextBlock.WrapDesiredSize},new go.Binding("text", "geo"))
  
  
      );
  
    // Define a Link template that routes orthogonally, with no arrowhead
    myDiagram.linkTemplate =
      $(go.Link,
        { routing: go.Link.Orthogonal, corner: 5, toShortLength: -2, fromShortLength: -2 },
        $(go.Shape, { strokeWidth: 2, stroke: colors["gray"] })); // the link shape
  
  
    myDiagram.addDiagramListener("TreeExpanded", function(e) {
      console.log("&gt;&gt;&gt;&gt;&gt; STUFF HAPPENED in TreeExpanded");
  
    });
  
    myDiagram.addDiagramListener("TreeCollapsed", function(e) {
      console.log("&gt;&gt;&gt;&gt;&gt; STUFF HAPPENED in TreeCollapsed");
    });
  
  
    // Create the model data that will be represented by Nodes and Links
    myDiagram.model = new go.GraphLinksModel(
      [
  </code></pre>
  
  <p>How do I detect when a node tree is expanded or collapsed, then call a function?</p>