title: How to DataBind DataContext for printing
body: <p>I have 2 XAML pages :</p>
  
  <p>a)  PagePrinting.xaml<br>
   b)  FormattedPage.xaml</p>
  
  <pre>
  --1--- in FormattedPage.xaml , I have a RichtextBlock :
  
  &lt;RichTextBlock>
   &lt;Paragraph>
   &lt;InlineUIContainer>
     &lt;ItemsControl ItemsSource="{Binding YourItems}">
      &lt;ItemsControl.ItemTemplate>
          &lt;DataTemplate> 
            &lt;!-- Data Template -->
          &lt;/DataTemplate>
       &lt;/ItemsControl.ItemTemplate>
   &lt;/ItemsControl>
  &lt;/InlineUIContainer>
  &lt;/Paragraph>
  &lt;/RichTextBlock>
  
  
  ------2--  In PagePrinting.xaml :
  
  I have the data from SQLite Db for FormattedPage.XAML for above (1)
  
  
  ObservableCollection &lt;Transaction> TransCollection = new ObservableCollection &lt;Transaction>();
  
  OnPageLoad :
  
  TransCollection.Clear();
  
  var db = new SQLiteAsyncConnection(dbPath);
  var Trans = await db.QueryAsync &lt;BizTransaction>("Select * From BizTransaction Where SalesId = '" + Id + "'");         
  
  int intRecord = Trans.Count();
  
  if (intRecord != 0)
   {
     foreach (var _trans in Trans)
     {
        int Id = _trans.Id;
        string Name = _trans.Description;
        string ItemNo = _trans.No;
        int Qty = (int)_trans.Quantity;
        decimal Price = _trans.UnitPrice;
        decimal LineAmt = _trans.LineAmount;
  
        //-- create a collection
       AddToList(Id, Name, ItemNo, Qty, Price, LineAmt);
  
     }
  
  
  this.DataContext = TransCollection;
  
   FrameworkElement page1;
  
   page1 = new FormattedPage();
  
   page1.DataContext = this.DataContext;
  
   CanvasPrintContainer.Children.Add(page1);
  
  
  
  The problems:
  
  1) is this correct ? 
  
  this.DataContext = TransCollection;
  page1.DataContext = this.DataContext;
  
  2) How to do Binding in FormattedPage.xaml using this DataContext?
  
  3) What need to be done in xaml section for PagePrinting for DataBinding ?
  
  
  Thanks
  
  </pre>