void OnPrintOptionsControlDataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     if (!(e.NewValue is PrintPreviewAreaControl))
     {
         return;
     }
     printDataContext = e.NewValue as PrintPreviewAreaControl;
     printManager     = printDataContext.PrintManagerBase;
 }
 /// <summary>
 /// Builds the visual tree for the print preview control when a new template is applied.
 /// </summary>
 public override void OnApplyTemplate()
 {
     base.OnApplyTemplate();
     PartPrintPreviewAreaControl = GetTemplateChild("PART_PrintPreviewAreaControl") as PrintPreviewAreaControl;
     Part_TextBox         = GetTemplateChild("PART_TextBox") as TextBox;
     PartZoomSlider       = GetTemplateChild("PART_ZoomSlider") as Slider;
     PartZoomInButton     = GetTemplateChild("PART_MinusZoomButton") as Button;
     PartZoomOutButton    = GetTemplateChild("PART_PlusZoomButton") as Button;
     Part_TextBox.ToolTip = new ToolTip();
     WireEvents();
 }
 /// <summary>
 /// Disposes all the resources used by the <see cref="Syncfusion.UI.Xaml.Grid.GridPrintPreviewControl"/> class.
 /// </summary>
 /// <param name="isDisposing">Indicates whether the call is from Dispose method or from a finalizer.</param>
 protected virtual void Dispose(bool isDisposing)
 {
     if (isdisposed)
     {
         return;
     }
     if (isDisposing)
     {
         printManager = null;
         PartPrintPreviewAreaControl = null;
     }
     isdisposed = true;
 }
 /// <summary>
 /// Disposes all the resources used by the <see cref="Syncfusion.UI.Xaml.Grid.PrintOptionsControl"/> class.
 /// </summary>
 /// <param name="isDisposing">Indicates whether the call is from Dispose method or from a finalizer.</param>
 protected virtual void Dispose(bool isDisposing)
 {
     if (isdisposed)
     {
         return;
     }
     if (pagesizes != null || pageThickness != null)
     {
         pagesizes.Clear();
         pageThickness.Clear();
     }
     if (isDisposing)
     {
         printManager     = null;
         printDataContext = null;
     }
     isdisposed = true;
 }