void SetupUserInterface() { mTabViewController = new PTTabbedDocumentViewController(); mTabViewController.TabsEnabled = false; UINavigationController navigationController = new UINavigationController(mTabViewController); AddChildViewController(navigationController); View.AddSubview(navigationController.View); navigationController.DidMoveToParentViewController(this); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); PTTabbedDocumentViewController tabbedDocumentViewController = mTabViewController; mTabViewController = null; nuint index = tabbedDocumentViewController.SelectedIndex; PTDocumentViewController documentViewController = tabbedDocumentViewController.SelectedViewController; PDFDoc pdfDoc = TypeConvertHelper.ConvPdfDocToManaged(documentViewController.PdfViewCtrl.GetDoc()); documentViewController.CloseDocumentWithCompletionHandler((bool success) => { pdfDoc.Close(); pdfDoc = null; }); tabbedDocumentViewController.RemoveTabAtIndex(index); tabbedDocumentViewController = null; GC.Collect(); }