diff --git a/.idea/.idea.Aaru/.idea/contentModel.xml b/.idea/.idea.Aaru/.idea/contentModel.xml
index bd5718eac..3c6b8b14d 100644
--- a/.idea/.idea.Aaru/.idea/contentModel.xml
+++ b/.idea/.idea.Aaru/.idea/contentModel.xml
@@ -1225,8 +1225,6 @@
-
-
@@ -1258,6 +1256,7 @@
+
@@ -1305,6 +1304,7 @@
+
@@ -1327,6 +1327,8 @@
+
+
diff --git a/Aaru.Gui/Forms/frmImageEntropy.xeto b/Aaru.Gui/Forms/frmImageEntropy.xeto
deleted file mode 100644
index 257ba4a95..000000000
--- a/Aaru.Gui/Forms/frmImageEntropy.xeto
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
\ No newline at end of file
diff --git a/Aaru.Gui/Forms/frmImageEntropy.xeto.cs b/Aaru.Gui/Forms/frmImageEntropy.xeto.cs
deleted file mode 100644
index dc8f47102..000000000
--- a/Aaru.Gui/Forms/frmImageEntropy.xeto.cs
+++ /dev/null
@@ -1,244 +0,0 @@
-// /***************************************************************************
-// Aaru Data Preservation Suite
-// ----------------------------------------------------------------------------
-//
-// Filename : frmImageEntropy.xeto.cs
-// Author(s) : Natalia Portillo
-//
-// Component : Image entropy calculation window.
-//
-// --[ Description ] ----------------------------------------------------------
-//
-// Implements calculating media image entropy.
-//
-// --[ License ] --------------------------------------------------------------
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General public License as
-// published by the Free Software Foundation, either version 3 of the
-// License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General public License for more details.
-//
-// You should have received a copy of the GNU General public License
-// along with this program. If not, see .
-//
-// ----------------------------------------------------------------------------
-// Copyright © 2011-2020 Natalia Portillo
-// ****************************************************************************/
-
-using System;
-using System.Threading;
-using Aaru.CommonTypes.Interfaces;
-using Aaru.Console;
-using Aaru.Core;
-using Eto.Forms;
-using Eto.Serialization.Xaml;
-
-namespace Aaru.Gui.Forms
-{
- public class frmImageEntropy : Form
- {
- readonly IMediaImage inputFormat;
- EntropyResults entropy;
- EntropyResults[] tracksEntropy;
-
- public frmImageEntropy(IMediaImage inputFormat)
- {
- this.inputFormat = inputFormat;
- XamlReader.Load(this);
-
- var inputOptical = inputFormat as IOpticalMediaImage;
-
- if(inputOptical?.Tracks != null &&
- inputOptical?.Tracks.Count > 0)
- {
- chkSeparatedTracks.Visible = true;
- chkWholeDisc.Visible = true;
- }
- else
- {
- chkSeparatedTracks.Checked = false;
- chkWholeDisc.Checked = true;
- }
- }
-
- protected void OnBtnStart(object sender, EventArgs e)
- {
- var entropyCalculator = new Entropy(false, false, inputFormat);
- entropyCalculator.InitProgressEvent += InitProgress;
- entropyCalculator.InitProgress2Event += InitProgress2;
- entropyCalculator.UpdateProgressEvent += UpdateProgress;
- entropyCalculator.UpdateProgress2Event += UpdateProgress2;
- entropyCalculator.EndProgressEvent += EndProgress;
- entropyCalculator.EndProgress2Event += EndProgress2;
- chkDuplicatedSectors.Enabled = false;
- chkSeparatedTracks.Enabled = false;
- chkWholeDisc.Enabled = false;
- btnClose.Visible = false;
- btnStart.Visible = false;
- btnStop.Visible = false;
- stkProgress.Visible = true;
-
- var thread = new Thread(() =>
- {
- if(chkSeparatedTracks.Checked == true)
- {
- tracksEntropy = entropyCalculator.CalculateTracksEntropy(chkDuplicatedSectors.Checked == true);
-
- foreach(EntropyResults trackEntropy in tracksEntropy)
- {
- AaruConsole.WriteLine("Entropy for track {0} is {1:F4}.", trackEntropy.Track,
- trackEntropy.Entropy);
-
- if(trackEntropy.UniqueSectors != null)
- AaruConsole.WriteLine("Track {0} has {1} unique sectors ({2:P3})", trackEntropy.Track,
- trackEntropy.UniqueSectors,
- (double)trackEntropy.UniqueSectors / (double)trackEntropy.Sectors);
- }
- }
-
- if(chkWholeDisc.Checked != true)
- return;
-
- entropy = entropyCalculator.CalculateMediaEntropy(chkDuplicatedSectors.Checked == true);
-
- Application.Instance.Invoke(Finish);
- });
-
- Statistics.AddCommand("entropy");
-
- thread.Start();
- }
-
- void Finish()
- {
- stkOptions.Visible = false;
- btnClose.Visible = true;
- stkProgress.Visible = false;
- stkResults.Visible = true;
-
- if(chkSeparatedTracks.Checked == true)
- {
- var entropyList = new TreeGridItemCollection();
-
- treeTrackEntropy.Columns.Add(new GridColumn
- {
- HeaderText = "Track", DataCell = new TextBoxCell(0)
- });
-
- treeTrackEntropy.Columns.Add(new GridColumn
- {
- HeaderText = "Entropy", DataCell = new TextBoxCell(1)
- });
-
- if(chkDuplicatedSectors.Checked == true)
- treeTrackEntropy.Columns.Add(new GridColumn
- {
- HeaderText = "Unique sectors", DataCell = new TextBoxCell(2)
- });
-
- treeTrackEntropy.AllowMultipleSelection = false;
- treeTrackEntropy.ShowHeader = true;
- treeTrackEntropy.DataStore = entropyList;
-
- foreach(EntropyResults trackEntropy in tracksEntropy)
- entropyList.Add(new TreeGridItem
- {
- Values = new object[]
- {
- trackEntropy.Track, trackEntropy.Entropy,
- $"{trackEntropy.UniqueSectors} ({(double)trackEntropy.UniqueSectors / (double)trackEntropy.Sectors:P3})"
- }
- });
-
- grpTrackEntropy.Visible = true;
- }
-
- if(chkWholeDisc.Checked != true)
- return;
-
- lblMediaEntropy.Text = $"Entropy for disk is {entropy.Entropy:F4}.";
- lblMediaEntropy.Visible = true;
-
- if(entropy.UniqueSectors == null)
- return;
-
- lblMediaUniqueSectors.Text =
- $"Disk has {entropy.UniqueSectors} unique sectors ({(double)entropy.UniqueSectors / (double)entropy.Sectors:P3})";
-
- lblMediaUniqueSectors.Visible = true;
- }
-
- protected void OnBtnClose(object sender, EventArgs e) => Close();
-
- protected void OnBtnStop(object sender, EventArgs e) => throw new NotImplementedException();
-
- void InitProgress() => stkProgress1.Visible = true;
-
- void EndProgress() => stkProgress1.Visible = false;
-
- void InitProgress2() => stkProgress2.Visible = true;
-
- void EndProgress2() => stkProgress2.Visible = false;
-
- void UpdateProgress(string text, long current, long maximum) =>
- UpdateProgress(text, current, maximum, lblProgress, prgProgress);
-
- void UpdateProgress2(string text, long current, long maximum) =>
- UpdateProgress(text, current, maximum, lblProgress2, prgProgress2);
-
- void UpdateProgress(string text, long current, long maximum, Label label, ProgressBar progressBar) =>
- Application.Instance.Invoke(() =>
- {
- label.Text = text;
-
- if(maximum == 0)
- {
- progressBar.Indeterminate = true;
-
- return;
- }
-
- if(progressBar.Indeterminate)
- progressBar.Indeterminate = false;
-
- if(maximum > int.MaxValue ||
- current > int.MaxValue)
- {
- progressBar.MaxValue = (int)(maximum / int.MaxValue);
- progressBar.Value = (int)(current / int.MaxValue);
- }
- else
- {
- progressBar.MaxValue = (int)maximum;
- progressBar.Value = (int)current;
- }
- });
-
- #region XAML IDs
- StackLayout stkOptions;
- CheckBox chkDuplicatedSectors;
- CheckBox chkSeparatedTracks;
- CheckBox chkWholeDisc;
- StackLayout stkResults;
- Label lblMediaEntropy;
- Label lblMediaUniqueSectors;
- GroupBox grpTrackEntropy;
- TreeGridView treeTrackEntropy;
- StackLayout stkProgress;
- StackLayout stkProgress1;
- Label lblProgress;
- ProgressBar prgProgress;
- StackLayout stkProgress2;
- Label lblProgress2;
- ProgressBar prgProgress2;
- Button btnStart;
- Button btnClose;
- Button btnStop;
- #endregion
- }
-}
\ No newline at end of file
diff --git a/Aaru.Gui/Models/TrackEntropyModel.cs b/Aaru.Gui/Models/TrackEntropyModel.cs
new file mode 100644
index 000000000..c50505077
--- /dev/null
+++ b/Aaru.Gui/Models/TrackEntropyModel.cs
@@ -0,0 +1,9 @@
+namespace Aaru.Gui.Models
+{
+ public class TrackEntropyModel
+ {
+ public string Track { get; set; }
+ public string Entropy { get; set; }
+ public string UniqueSectors { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Aaru.Gui/ViewModels/ImageEntropyViewModel.cs b/Aaru.Gui/ViewModels/ImageEntropyViewModel.cs
new file mode 100644
index 000000000..3b889eef5
--- /dev/null
+++ b/Aaru.Gui/ViewModels/ImageEntropyViewModel.cs
@@ -0,0 +1,385 @@
+using System;
+using System.Collections.ObjectModel;
+using System.Globalization;
+using System.Reactive;
+using System.Threading;
+using Aaru.CommonTypes.Interfaces;
+using Aaru.Console;
+using Aaru.Core;
+using Aaru.Gui.Models;
+using Avalonia.Controls;
+using Avalonia.Threading;
+using ReactiveUI;
+
+namespace Aaru.Gui.ViewModels
+{
+ public class ImageEntropyViewModel : ViewModelBase
+ {
+ readonly IMediaImage _inputFormat;
+ bool _closeVisible;
+ bool _duplicatedSectorsChecked;
+ bool _duplicatedSectorsEnabled;
+ EntropyResults _entropy;
+ string _mediaEntropyText;
+ bool _mediaEntropyVisible;
+ string _mediaUniqueSectorsText;
+ bool _mediaUniqueSectorsVisible;
+ bool _optionsVisible;
+ bool _progress1Visible;
+ bool _progress2Indeterminate;
+ double _progress2Max;
+ string _progress2Text;
+ double _progress2Value;
+ bool _progress2Visible;
+ bool _progressIndeterminate;
+ double _progressMax;
+ string _progressText;
+ double _progressValue;
+ bool _progressVisible;
+ bool _resultsVisible;
+ bool _separatedTracksChecked;
+ bool _separatedTracksEnabled;
+ bool _separatedTracksVisible;
+ bool _startVisible;
+ bool _stopVisible;
+ EntropyResults[] _tracksEntropy;
+ readonly Window _view;
+ bool _wholeDiscChecked;
+ bool _wholeDiscEnabled;
+ bool _wholeDiscVisible;
+
+ public ImageEntropyViewModel(IMediaImage inputFormat, Window view)
+ {
+ _inputFormat = inputFormat;
+ _view = view;
+ TrackEntropy = new ObservableCollection();
+ StartCommand = ReactiveCommand.Create(ExecuteStartCommand);
+ CloseCommand = ReactiveCommand.Create(ExecuteCloseCommand);
+ StopCommand = ReactiveCommand.Create(ExecuteStopCommand);
+ OptionsVisible = true;
+ DuplicatedSectorsChecked = true;
+ SeparatedTracksChecked = true;
+ WholeDiscChecked = true;
+ StartVisible = true;
+
+ var inputOptical = inputFormat as IOpticalMediaImage;
+
+ if(inputOptical?.Tracks.Count > 0)
+ {
+ SeparatedTracksVisible = true;
+ WholeDiscVisible = true;
+ }
+ else
+ {
+ SeparatedTracksChecked = false;
+ WholeDiscChecked = true;
+ }
+ }
+
+ public bool SeparatedTracksVisible
+ {
+ get => _separatedTracksVisible;
+ set => this.RaiseAndSetIfChanged(ref _separatedTracksVisible, value);
+ }
+
+ public bool WholeDiscVisible
+ {
+ get => _wholeDiscVisible;
+ set => this.RaiseAndSetIfChanged(ref _wholeDiscVisible, value);
+ }
+
+ public bool SeparatedTracksChecked
+ {
+ get => _separatedTracksChecked;
+ set => this.RaiseAndSetIfChanged(ref _separatedTracksChecked, value);
+ }
+
+ public bool WholeDiscChecked
+ {
+ get => _wholeDiscChecked;
+ set => this.RaiseAndSetIfChanged(ref _wholeDiscChecked, value);
+ }
+
+ public bool DuplicatedSectorsEnabled
+ {
+ get => _duplicatedSectorsEnabled;
+ set => this.RaiseAndSetIfChanged(ref _duplicatedSectorsEnabled, value);
+ }
+
+ public bool SeparatedTracksEnabled
+ {
+ get => _separatedTracksEnabled;
+ set => this.RaiseAndSetIfChanged(ref _separatedTracksEnabled, value);
+ }
+
+ public bool WholeDiscEnabled
+ {
+ get => _wholeDiscEnabled;
+ set => this.RaiseAndSetIfChanged(ref _wholeDiscEnabled, value);
+ }
+
+ public bool CloseVisible
+ {
+ get => _closeVisible;
+ set => this.RaiseAndSetIfChanged(ref _closeVisible, value);
+ }
+
+ public bool StartVisible
+ {
+ get => _startVisible;
+ set => this.RaiseAndSetIfChanged(ref _startVisible, value);
+ }
+
+ public bool StopVisible
+ {
+ get => _stopVisible;
+ set => this.RaiseAndSetIfChanged(ref _stopVisible, value);
+ }
+
+ public bool ProgressVisible
+ {
+ get => _progressVisible;
+ set => this.RaiseAndSetIfChanged(ref _progressVisible, value);
+ }
+
+ public bool DuplicatedSectorsChecked
+ {
+ get => _duplicatedSectorsChecked;
+ set => this.RaiseAndSetIfChanged(ref _duplicatedSectorsChecked, value);
+ }
+
+ public bool OptionsVisible
+ {
+ get => _optionsVisible;
+ set => this.RaiseAndSetIfChanged(ref _optionsVisible, value);
+ }
+
+ public bool ResultsVisible
+ {
+ get => _resultsVisible;
+ set => this.RaiseAndSetIfChanged(ref _resultsVisible, value);
+ }
+
+ public string MediaEntropyText
+ {
+ get => _mediaEntropyText;
+ set => this.RaiseAndSetIfChanged(ref _mediaEntropyText, value);
+ }
+
+ public bool MediaEntropyVisible
+ {
+ get => _mediaEntropyVisible;
+ set => this.RaiseAndSetIfChanged(ref _mediaEntropyVisible, value);
+ }
+
+ public string MediaUniqueSectorsText
+ {
+ get => _mediaUniqueSectorsText;
+ set => this.RaiseAndSetIfChanged(ref _mediaUniqueSectorsText, value);
+ }
+
+ public bool MediaUniqueSectorsVisible
+ {
+ get => _mediaUniqueSectorsVisible;
+ set => this.RaiseAndSetIfChanged(ref _mediaUniqueSectorsVisible, value);
+ }
+
+ public bool Progress1Visible
+ {
+ get => _progress1Visible;
+ set => this.RaiseAndSetIfChanged(ref _progress1Visible, value);
+ }
+
+ public bool Progress2Visible
+ {
+ get => _progress2Visible;
+ set => this.RaiseAndSetIfChanged(ref _progress2Visible, value);
+ }
+
+ public string ProgressText
+ {
+ get => _progressText;
+ set => this.RaiseAndSetIfChanged(ref _progressText, value);
+ }
+
+ public bool ProgressIndeterminate
+ {
+ get => _progressIndeterminate;
+ set => this.RaiseAndSetIfChanged(ref _progressIndeterminate, value);
+ }
+
+ public double ProgressMax
+ {
+ get => _progressMax;
+ set => this.RaiseAndSetIfChanged(ref _progressMax, value);
+ }
+
+ public double ProgressValue
+ {
+ get => _progressValue;
+ set => this.RaiseAndSetIfChanged(ref _progressValue, value);
+ }
+
+ public string Progress2Text
+ {
+ get => _progress2Text;
+ set => this.RaiseAndSetIfChanged(ref _progress2Text, value);
+ }
+
+ public bool Progress2Indeterminate
+ {
+ get => _progress2Indeterminate;
+ set => this.RaiseAndSetIfChanged(ref _progress2Indeterminate, value);
+ }
+
+ public double Progress2Max
+ {
+ get => _progress2Max;
+ set => this.RaiseAndSetIfChanged(ref _progress2Max, value);
+ }
+
+ public double Progress2Value
+ {
+ get => _progress2Value;
+ set => this.RaiseAndSetIfChanged(ref _progress2Value, value);
+ }
+
+ public string Title => "Calculating entropy";
+ public ObservableCollection TrackEntropy { get; }
+ public ReactiveCommand StartCommand { get; }
+ public ReactiveCommand CloseCommand { get; }
+ public ReactiveCommand StopCommand { get; }
+
+ void ExecuteStartCommand()
+ {
+ var entropyCalculator = new Entropy(false, false, _inputFormat);
+ entropyCalculator.InitProgressEvent += InitProgress;
+ entropyCalculator.InitProgress2Event += InitProgress2;
+ entropyCalculator.UpdateProgressEvent += UpdateProgress;
+ entropyCalculator.UpdateProgress2Event += UpdateProgress2;
+ entropyCalculator.EndProgressEvent += EndProgress;
+ entropyCalculator.EndProgress2Event += EndProgress2;
+ DuplicatedSectorsEnabled = false;
+ SeparatedTracksEnabled = false;
+ WholeDiscEnabled = false;
+ CloseVisible = false;
+ StartVisible = false;
+ StopVisible = false;
+ ProgressVisible = true;
+
+ var thread = new Thread(async () =>
+ {
+ if(SeparatedTracksChecked)
+ {
+ _tracksEntropy = entropyCalculator.CalculateTracksEntropy(DuplicatedSectorsChecked);
+
+ foreach(EntropyResults trackEntropy in _tracksEntropy)
+ {
+ AaruConsole.WriteLine("Entropy for track {0} is {1:F4}.", trackEntropy.Track,
+ trackEntropy.Entropy);
+
+ if(trackEntropy.UniqueSectors != null)
+ AaruConsole.WriteLine("Track {0} has {1} unique sectors ({2:P3})", trackEntropy.Track,
+ trackEntropy.UniqueSectors,
+ (double)trackEntropy.UniqueSectors / (double)trackEntropy.Sectors);
+ }
+ }
+
+ if(WholeDiscChecked != true)
+ return;
+
+ _entropy = entropyCalculator.CalculateMediaEntropy(DuplicatedSectorsChecked);
+
+ await Dispatcher.UIThread.InvokeAsync(Finish);
+ });
+
+ Statistics.AddCommand("entropy");
+
+ thread.Start();
+ }
+
+ void Finish()
+ {
+ OptionsVisible = false;
+ CloseVisible = true;
+ ProgressVisible = false;
+ ResultsVisible = true;
+
+ if(SeparatedTracksChecked)
+ {
+ foreach(EntropyResults trackEntropy in _tracksEntropy)
+ TrackEntropy.Add(new TrackEntropyModel
+ {
+ Track = trackEntropy.Track.ToString(),
+ Entropy = trackEntropy.Entropy.ToString(CultureInfo.CurrentUICulture),
+ UniqueSectors =
+ $"{trackEntropy.UniqueSectors} ({(double)(trackEntropy.UniqueSectors ?? 0) / (double)trackEntropy.Sectors:P3})"
+ });
+ }
+
+ if(WholeDiscChecked != true)
+ return;
+
+ MediaEntropyText = $"Entropy for disk is {_entropy.Entropy:F4}.";
+ MediaEntropyVisible = true;
+
+ if(_entropy.UniqueSectors == null)
+ return;
+
+ MediaUniqueSectorsText =
+ $"Disk has {_entropy.UniqueSectors} unique sectors ({(double)_entropy.UniqueSectors / (double)_entropy.Sectors:P3})";
+
+ MediaUniqueSectorsVisible = true;
+ }
+
+ void ExecuteCloseCommand() => _view.Close();
+
+ void ExecuteStopCommand() => throw new NotImplementedException();
+
+ void InitProgress() => Progress1Visible = true;
+
+ void EndProgress() => Progress1Visible = false;
+
+ void InitProgress2() => Progress2Visible = true;
+
+ void EndProgress2() => Progress2Visible = false;
+
+ async void UpdateProgress(string text, long current, long maximum) =>
+ await Dispatcher.UIThread.InvokeAsync(() =>
+ {
+ ProgressText = text;
+
+ if(maximum == 0)
+ {
+ ProgressIndeterminate = true;
+
+ return;
+ }
+
+ if(ProgressIndeterminate)
+ ProgressIndeterminate = false;
+
+ ProgressMax = maximum;
+ ProgressValue = current;
+ });
+
+ async void UpdateProgress2(string text, long current, long maximum) =>
+ await Dispatcher.UIThread.InvokeAsync(() =>
+ {
+ Progress2Text = text;
+
+ if(maximum == 0)
+ {
+ Progress2Indeterminate = true;
+
+ return;
+ }
+
+ if(Progress2Indeterminate)
+ Progress2Indeterminate = false;
+
+ Progress2Max = maximum;
+ Progress2Value = current;
+ });
+ }
+}
\ No newline at end of file
diff --git a/Aaru.Gui/ViewModels/ImageInfoViewModel.cs b/Aaru.Gui/ViewModels/ImageInfoViewModel.cs
index 284fd43a2..ef9603a5c 100644
--- a/Aaru.Gui/ViewModels/ImageInfoViewModel.cs
+++ b/Aaru.Gui/ViewModels/ImageInfoViewModel.cs
@@ -30,9 +30,9 @@ namespace Aaru.Gui.ViewModels
readonly IMediaImage _imageFormat;
readonly Window _view;
IFilter _filter;
-
- ImageChecksumWindow _imageChecksumWindow;
- string _imagePath;
+ ImageChecksumWindow _imageChecksumWindow;
+ ImageEntropyWindow _imageEntropyWindow;
+ string _imagePath;
public ImageInfoViewModel(string imagePath, IFilter filter, IMediaImage imageFormat, Window view)
@@ -705,23 +705,22 @@ namespace Aaru.Gui.ViewModels
protected void ExecuteEntropyCommand()
{
- /* TODO: frmImageEntropy
- if(frmImageEntropy != null)
+ if(_imageEntropyWindow != null)
{
- frmImageEntropy.Show();
+ _imageEntropyWindow.Show();
return;
}
- frmImageEntropy = new frmImageEntropy(imageFormat);
+ _imageEntropyWindow = new ImageEntropyWindow();
+ _imageEntropyWindow.DataContext = new ImageEntropyViewModel(_imageFormat, _imageEntropyWindow);
- frmImageEntropy.Closed += (s, ea) =>
+ _imageEntropyWindow.Closed += (sender, args) =>
{
- frmImageEntropy = null;
+ _imageEntropyWindow = null;
};
- frmImageEntropy.Show();
- */
+ _imageEntropyWindow.Show();
}
protected void ExecuteVerifyCommand()
diff --git a/Aaru.Gui/Views/ImageEntropyWindow.xaml b/Aaru.Gui/Views/ImageEntropyWindow.xaml
new file mode 100644
index 000000000..c61c33d1a
--- /dev/null
+++ b/Aaru.Gui/Views/ImageEntropyWindow.xaml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Aaru.Gui/Views/ImageEntropyWindow.xaml.cs b/Aaru.Gui/Views/ImageEntropyWindow.xaml.cs
new file mode 100644
index 000000000..cd5fdb9e0
--- /dev/null
+++ b/Aaru.Gui/Views/ImageEntropyWindow.xaml.cs
@@ -0,0 +1,27 @@
+using System.ComponentModel;
+using Aaru.Gui.ViewModels;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace Aaru.Gui.Views
+{
+ public class ImageEntropyWindow : Window
+ {
+ public ImageEntropyWindow()
+ {
+ InitializeComponent();
+ #if DEBUG
+ this.AttachDevTools();
+ #endif
+ }
+
+ void InitializeComponent() => AvaloniaXamlLoader.Load(this);
+
+ protected override void OnClosing(CancelEventArgs e)
+ {
+ (DataContext as ImageChecksumViewModel)?.ExecuteStopCommand();
+ base.OnClosing(e);
+ }
+ }
+}
\ No newline at end of file