diff --git a/QuickViewFile/MainWindow.xaml b/QuickViewFile/MainWindow.xaml
index 0ef40c1..6103a2f 100644
--- a/QuickViewFile/MainWindow.xaml
+++ b/QuickViewFile/MainWindow.xaml
@@ -6,6 +6,8 @@
xmlns:local="clr-namespace:QuickViewFile.Controls"
xmlns:helpers="clr-namespace:QuickViewFile.Helpers"
xmlns:viewmodel="clr-namespace:QuickViewFile.ViewModel"
+ xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
+ xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
d:DataContext="{d:DesignInstance Type=viewmodel:FilesListViewModel}"
mc:Ignorable="d"
WindowState="Maximized"
@@ -252,6 +254,20 @@
/>
+
+
+
diff --git a/QuickViewFile/MainWindowNoBorder.xaml b/QuickViewFile/MainWindowNoBorder.xaml
index 6271a27..9ce6503 100644
--- a/QuickViewFile/MainWindowNoBorder.xaml
+++ b/QuickViewFile/MainWindowNoBorder.xaml
@@ -6,6 +6,8 @@
xmlns:local="clr-namespace:QuickViewFile.Controls"
xmlns:helpers="clr-namespace:QuickViewFile.Helpers"
xmlns:viewmodel="clr-namespace:QuickViewFile.ViewModel"
+ xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
+ xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
d:DataContext="{d:DesignInstance Type=viewmodel:FilesListViewModel}"
mc:Ignorable="d"
WindowState="Maximized"
@@ -244,6 +246,20 @@
/>
+
+
+
diff --git a/QuickViewFile/Models/FileContentModel.cs b/QuickViewFile/Models/FileContentModel.cs
index 9087283..9f3eb10 100644
--- a/QuickViewFile/Models/FileContentModel.cs
+++ b/QuickViewFile/Models/FileContentModel.cs
@@ -1,12 +1,21 @@
using QuickViewFile.Controls;
using System.Windows.Media;
using System.Windows.Media.Imaging;
+using System.ComponentModel;
+using System.Runtime.CompilerServices;
namespace QuickViewFile.Models
{
- public class FileContentModel : IDisposable
+ public class FileContentModel : IDisposable, INotifyPropertyChanged
{
- public string? TextContent { get; set; } = null;
+ public event PropertyChangedEventHandler? PropertyChanged;
+ protected void OnPropertyChanged([CallerMemberName] string name = null)
+ {
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
+ }
+
+ private string? _textContent = null;
+ public string? TextContent { get => _textContent; set { _textContent = value; OnPropertyChanged(); } }
public ImageSource? ImageSource { get; set; } = null;
@@ -15,6 +24,14 @@ public class FileContentModel : IDisposable
public bool IsLoaded { get; set; } = false;
public bool ShowTextBox { get; set; } = false;
+ private bool _showWebView = false;
+ public bool ShowWebView { get => _showWebView; set { _showWebView = value; OnPropertyChanged(); } }
+
+ public bool ShowCodeEditor { get; set; } = false;
+
+ private string? _webViewSource = null;
+ public string? WebViewSource { get => _webViewSource; set { _webViewSource = value; OnPropertyChanged(); } }
+
public void Dispose()
{
// Dispose of managed resources.
@@ -31,6 +48,9 @@ public void Dispose()
IsLoaded = false;
ShowTextBox = false;
+ ShowWebView = false;
+ ShowCodeEditor = false;
+ WebViewSource = null;
// Suppress finalization to prevent GC from calling finalizer on disposed object.
GC.SuppressFinalize(this);
diff --git a/QuickViewFile/QuickViewFile.csproj b/QuickViewFile/QuickViewFile.csproj
index 222daff..3aff400 100644
--- a/QuickViewFile/QuickViewFile.csproj
+++ b/QuickViewFile/QuickViewFile.csproj
@@ -57,4 +57,10 @@
+
+
+
+
+
+