26 lines
678 B
C#
26 lines
678 B
C#
using System;
|
|
using System.Windows;
|
|
using Elwig.Helpers;
|
|
|
|
namespace Elwig.Windows {
|
|
public partial class DocumentViewerWindow : Window {
|
|
|
|
private TempFile? PdfFile = null;
|
|
|
|
public DocumentViewerWindow(string title, string path) {
|
|
InitializeComponent();
|
|
Title = Title + " - " + title;
|
|
WebView.Source = new($"file://{path}#view=FitH");
|
|
}
|
|
|
|
public DocumentViewerWindow(string title, TempFile file) : this(title, file.FilePath) {
|
|
PdfFile = file;
|
|
}
|
|
|
|
public void OnClosed(object sender, EventArgs evt) {
|
|
PdfFile?.Dispose();
|
|
PdfFile = null;
|
|
}
|
|
}
|
|
}
|