title: While Using a Print Functionality in Windows Universal App in Windows-10 ,the PrintingRoot.Children.Add(firstPage) Getting Null exception Error
body: <p>I am implementing a print functionality which has almost done but when  clicking on the the print button its throw a null exception in the  <code>PrintingRoot.Children.Add(firstPage)</code>.</p>
  
  <p>Code:</p>
  
  <pre><code>protected override void PreparePrintContent()
  {
      try
      {
          trys = trysgetorderdetail;
          OrderDetailResponse obj1 = JsonConvert.DeserializeObject&lt;OrderDetailResponse&gt;(trys);
          if (firstPage == null)
          {
              firstPage = new popup(obj1);
          }
  
          PrintingRoot.Children.Add(firstPage);
          PrintingRoot.InvalidateMeasure();
          PrintingRoot.UpdateLayout();
      }
      catch (HttpRequestException ex)
      {
  
      }
      catch (Exception ex) { }
  }
  
  protected virtual Canvas PrintingRoot
  {
      get
      {
          return FindName("printingRoot") as Canvas;
      }   
  }
  </code></pre>
  
  <p>So suggest me a solution </p>