title: Prevent content with child nodes from being deleted in umbraco
body: <p>I would like to prevent content nodes from being trashed if they have any children.  I setup an event handler like so:</p>
  
  <pre><code>public class KeepSafeEvents : ApplicationBase
  {
      public KeepSafeEvents()
      {
          Document.BeforeMoveToTrash += new Document.MoveToTrashEventHandler(Document_BeforeMoveToTrash);
      }
  
      void Document_BeforeMoveToTrash(Document sender, umbraco.cms.businesslogic.MoveToTrashEventArgs e)
      {
          if (sender.HasChildren)
          {
              e.Cancel = true;
          }
      }
  }
  </code></pre>
  
  <p>However, this doesn't seem to work.  I assume it is because the delete process moves the child nodes to trash first before dealing with the parent node (which then has no children).  Is there another possible solution?  Or am I making a simple mistake above?</p>