title: How to add CSS StyleClass when instantiating object, instead of object.addStyleClass("myStyle")
body: <p>I work with SAPUI5, and I want to add a style to an object as soon as I instantiate it. For example, I want to add styleclass 'foo' to my label inside my panel.</p>
  
  <p>What I want to do, but doesn't work:</p>
  
  <pre><code>var oPanel = new sap.m.Panel({
   content: new sap.m.Label({
   text: "Hello",
   styleClass: "foo"
   })
  });
  </code></pre>
  
  <p>What I don't want to do, but does work:</p>
  
  <pre><code>var oLabel = new sap.m.Label({
  text: "Hello"
  });
  oLabel.addStyleClass("foo");
  
  var oPanel = new sap.m.Panel({
  content: oLabel
  });
  </code></pre>