From 61cda74f8da7ac781446a306427c0281e1afb949 Mon Sep 17 00:00:00 2001 From: Martin Zikmund Date: Sun, 11 Aug 2024 18:22:39 +0200 Subject: [PATCH] Fix post preview --- src/Directory.Build.targets | 2 ++ .../Assets/PostPreviewTemplate.html | 25 +++++++++++++++++++ .../Views/Admin/PostEditorView.xaml.cs | 2 +- src/app/MZikmund.App/Views/PostView.xaml.cs | 2 +- 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 src/app/MZikmund.App/Assets/PostPreviewTemplate.html diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index 8c119d5..1461fac 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets @@ -1,2 +1,4 @@ + + diff --git a/src/app/MZikmund.App/Assets/PostPreviewTemplate.html b/src/app/MZikmund.App/Assets/PostPreviewTemplate.html new file mode 100644 index 0000000..9fd39bd --- /dev/null +++ b/src/app/MZikmund.App/Assets/PostPreviewTemplate.html @@ -0,0 +1,25 @@ + + + + + + + + + + + + + +
+
+
+ +
+ {POSTCONTENT} +
+
+
+
+ + diff --git a/src/app/MZikmund.App/Views/Admin/PostEditorView.xaml.cs b/src/app/MZikmund.App/Views/Admin/PostEditorView.xaml.cs index 419fc95..c0a1e6d 100644 --- a/src/app/MZikmund.App/Views/Admin/PostEditorView.xaml.cs +++ b/src/app/MZikmund.App/Views/Admin/PostEditorView.xaml.cs @@ -14,7 +14,7 @@ public PostEditorView() { InitializeComponent(); // Read the template from the embedded resource - _postPreviewTemplate = typeof(PostEditorView).GetAssembly().GetManifestResourceStream("MZikmund.Assets.PostPreviewTemplate.html")?.ReadToEnd()!; + _postPreviewTemplate = typeof(PostEditorView).Assembly.GetManifestResourceStream("MZikmund.App.Assets.PostPreviewTemplate.html")!.ReadToEnd()!; PreviewWebViewContainer.Content = _previewWebView = new WebView2(); this.Loaded += PostEditorView_Loaded; this.Unloaded += PostEditorView_Unloaded; diff --git a/src/app/MZikmund.App/Views/PostView.xaml.cs b/src/app/MZikmund.App/Views/PostView.xaml.cs index bfc01b4..f215183 100644 --- a/src/app/MZikmund.App/Views/PostView.xaml.cs +++ b/src/app/MZikmund.App/Views/PostView.xaml.cs @@ -27,7 +27,7 @@ public PostView() { InitializeComponent(); // Read the template from the embedded resource - _postPreviewTemplate = typeof(PostView).GetAssembly().GetManifestResourceStream("MZikmund.Assets.PostPreviewTemplate.html")?.ReadToEnd()!; + _postPreviewTemplate = typeof(PostView).Assembly.GetManifestResourceStream("MZikmund.App.Assets.PostPreviewTemplate.html")?.ReadToEnd()!; PreviewWebViewContainer.Content = _previewWebView = new WebView2(); this.Loaded += PostEditorView_Loaded; this.Unloaded += PostEditorView_Unloaded;