void ViewDocument(SynchronizeEntity sourceData, string header = null) { if (header == null) { header = string.Format("{0} {1}", Uniconta.ClientTools.Localization.lookup("View"), Uniconta.ClientTools.Localization.lookup("PhysicalVoucher")); } if (docViewer == null) { docViewer = new DocumentViewerWindow(api, header); docViewer.InitViewer(sourceData); docViewer.Owner = Application.Current.MainWindow; docViewer.Closing += delegate { docViewer.Owner = null; }; docViewer.Closed += delegate { docViewer = null; }; } if (DocumentViewerWindow.lastHeight != 0) { docViewer.Width = DocumentViewerWindow.lastWidth; docViewer.Height = DocumentViewerWindow.lastHeight; } if (DocumentViewerWindow.isMaximized) { docViewer.WindowState = WindowState.Maximized; } docViewer.Show(); }
private void ShowViewer(InvItemClient invItem, int rowId, string header, ViewerType docViewerType) { if (rowId == 0) { return; } var newDocumentViewer = new DocumentViewerWindow(api, header); newDocumentViewer.DocumentViewerType = docViewerType; newDocumentViewer.InitViewer(invItem); newDocumentViewer.Show(); }