diff --git a/source/Aehnlich/Aehnlich/ViewModels/DocDiff/DocDiffDocViewViewModel.cs b/source/Aehnlich/Aehnlich/ViewModels/DocDiff/DocDiffDocViewViewModel.cs
index 4f5b58c..6923285 100644
--- a/source/Aehnlich/Aehnlich/ViewModels/DocDiff/DocDiffDocViewViewModel.cs
+++ b/source/Aehnlich/Aehnlich/ViewModels/DocDiff/DocDiffDocViewViewModel.cs
@@ -1,6 +1,7 @@
namespace Aehnlich.ViewModels.Documents
{
using Aehnlich.Interfaces;
+ using AehnlichLib.Enums;
using AehnlichViewModelsLib.Enums;
using HL.Interfaces;
using System;
@@ -35,9 +36,11 @@ internal class DocDiffDocViewViewModel : DocumentBaseViewModel, TextDocDifferenc
///
///
///
+ ///
public DocDiffDocViewViewModel(IDocumentManagerViewModel docManager,
string leftFilePath,
- string rightFilePath)
+ string rightFilePath,
+ CompareType compareAs)
: this()
{
_DocumentManager = docManager;
@@ -45,7 +48,7 @@ public DocDiffDocViewViewModel(IDocumentManagerViewModel docManager,
Title = GetTitle(leftFilePath, rightFilePath, false);
ToolTip = GetTooltip(leftFilePath, rightFilePath);
- DocDiffDoc = AehnlichViewModelsLib.ViewModels.Factory.ConstructAppViewModel(leftFilePath, rightFilePath);
+ DocDiffDoc = AehnlichViewModelsLib.ViewModels.Factory.ConstructAppViewModel(leftFilePath, rightFilePath, compareAs);
DocDiffDoc.DocumentPropertyChanged += DocDiffDoc_DocumentPropertyChanged;
}
diff --git a/source/Aehnlich/Aehnlich/ViewModels/DocumentManagerViewModel.cs b/source/Aehnlich/Aehnlich/ViewModels/DocumentManagerViewModel.cs
index 407ebc1..79d07ce 100644
--- a/source/Aehnlich/Aehnlich/ViewModels/DocumentManagerViewModel.cs
+++ b/source/Aehnlich/Aehnlich/ViewModels/DocumentManagerViewModel.cs
@@ -116,7 +116,7 @@ public void DocDiffDoc_CompareFilesRequest(object sender, OpenFileDiffEventArgs
if (oldDoc == null) // Add new document and activate it
{
- var newDoc = new DocDiffDocViewViewModel(this, e.ItemPathA, e.ItemPathB);
+ var newDoc = new DocDiffDocViewViewModel(this, e.ItemPathA, e.ItemPathB, e.CompareAs);
// CompareFilesCommand is executed via ViewLoadedCommand()
AddDocument(newDoc, true);
diff --git a/source/Aehnlich/Aehnlich/Views/Dir/DirDiffDocView.xaml b/source/Aehnlich/Aehnlich/Views/Dir/DirDiffDocView.xaml
index e59d83d..39ab8af 100644
--- a/source/Aehnlich/Aehnlich/Views/Dir/DirDiffDocView.xaml
+++ b/source/Aehnlich/Aehnlich/Views/Dir/DirDiffDocView.xaml
@@ -1,13 +1,13 @@
+ x:Class="Aehnlich.Views.Dir.DirDiffDocView"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:views="clr-namespace:AehnlichDirViewModelLib.Views;assembly=AehnlichDirViewModelLib"
+ d:DesignHeight="450"
+ d:DesignWidth="800"
+ mc:Ignorable="d">
-
+
diff --git a/source/Demos/Dir/AehnlichDirViewModelLib/Events/OpenFileDiffEvent.cs b/source/Demos/Dir/AehnlichDirViewModelLib/Events/OpenFileDiffEvent.cs
index d44274c..d626279 100644
--- a/source/Demos/Dir/AehnlichDirViewModelLib/Events/OpenFileDiffEvent.cs
+++ b/source/Demos/Dir/AehnlichDirViewModelLib/Events/OpenFileDiffEvent.cs
@@ -1,6 +1,7 @@
namespace AehnlichDirViewModelLib.Events
{
using AehnlichDirViewModelLib.Interfaces;
+ using AehnlichLib.Enums;
using System;
///
@@ -10,6 +11,17 @@
public class OpenFileDiffEventArgs : EventArgs
{
#region ctors
+ ///
+ /// Class constructor
+ ///
+ ///
+ ///
+ public OpenFileDiffEventArgs(IDirEntryViewModel pathItem, CompareType compareAs)
+ : this(pathItem)
+ {
+ CompareAs = compareAs;
+ }
+
///
/// Class constructor
///
@@ -31,6 +43,7 @@ public OpenFileDiffEventArgs(IDirEntryViewModel pathItem)
///
protected OpenFileDiffEventArgs()
{
+ CompareAs = CompareType.Auto;
}
#endregion ctors
@@ -65,6 +78,11 @@ protected OpenFileDiffEventArgs()
/// Gets whether this entry represent a file (true), or not (directory or drive).
///
public bool IsFile { get; }
+
+ ///
+ /// Determines the mode of comparison when files are compared (default is Auto).
+ ///
+ public CompareType CompareAs { get; }
#endregion properties
}
}
diff --git a/source/Demos/Dir/AehnlichDirViewModelLib/ViewModels/DirDiffDocViewModel.cs b/source/Demos/Dir/AehnlichDirViewModelLib/ViewModels/DirDiffDocViewModel.cs
index 5ad7f52..985df16 100644
--- a/source/Demos/Dir/AehnlichDirViewModelLib/ViewModels/DirDiffDocViewModel.cs
+++ b/source/Demos/Dir/AehnlichDirViewModelLib/ViewModels/DirDiffDocViewModel.cs
@@ -6,6 +6,7 @@
using AehnlichDirViewModelLib.Models;
using AehnlichDirViewModelLib.ViewModels.Base;
using AehnlichLib.Dir;
+ using AehnlichLib.Enums;
using AehnlichLib.Interfaces;
using System;
using System.Collections.Generic;
@@ -33,6 +34,7 @@ internal class DirDiffDocViewModel : Base.ViewModelBase, IDirDiffDocViewModel
private DiffViewModeEnum _CurrentViewMode = DiffViewModeEnum.DirectoriesAndFiles;
private ICommand _BrowseItemCommand;
+ private ICommand _CompareFilesCommand;
private ICommand _BrowseUpCommand;
private ICommand _OpenContainingFolderCommand;
private ICommand _OpenInWindowsCommand;
@@ -350,6 +352,90 @@ public ICommand BrowseItemCommand
}
}
+ ///
+ /// Gets a command to browse the current directory diff view by one level down
+ /// (if there is a current view and a remaining level down is available).
+ ///
+ public ICommand CompareFilesCommand
+ {
+ get
+ {
+ if (_CompareFilesCommand == null)
+ {
+ _CompareFilesCommand = new RelayCommand