Templates working
This commit is contained in:
@ -6,6 +6,7 @@
|
||||
xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
|
||||
xmlns:local="clr-namespace:WGneu.Windows"
|
||||
mc:Ignorable="d"
|
||||
Closed="OnClosed"
|
||||
Title="PDF Ansicht"
|
||||
MinHeight="600" MinWidth="420" Height="750" Width="525">
|
||||
<Grid>
|
||||
|
@ -14,10 +14,22 @@ using System.Windows.Shapes;
|
||||
|
||||
namespace WGneu.Windows {
|
||||
public partial class DocumentViewerWindow : Window {
|
||||
|
||||
private Utils.TemporaryFile? PdfFile = null;
|
||||
|
||||
public DocumentViewerWindow(string title, string path) {
|
||||
InitializeComponent();
|
||||
Title = Title + " - " + title;
|
||||
WebView.Source = new("file://" + path);
|
||||
}
|
||||
|
||||
public DocumentViewerWindow(string title, Utils.TemporaryFile file) : this(title, file.FilePath) {
|
||||
PdfFile = file;
|
||||
}
|
||||
|
||||
public void OnClosed(object sender, EventArgs e) {
|
||||
PdfFile?.Dispose();
|
||||
PdfFile = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user