Remove deprecated dependencies

- Remove CommonServiceLocator
- Remove GalaSoft.MvvmLight
- Add CommunityToolkit.Mvvm
This commit is contained in:
Adrien Allard 2024-01-17 16:13:54 +01:00
parent 51b14edda9
commit 2c8fe8a4c7
37 changed files with 376 additions and 465 deletions

View File

@ -1,14 +1,26 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup> </startup>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="Languages"/> <probing privatePath="Languages" />
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="CommonServiceLocator" publicKeyToken="489b6accfaf20ef0" culture="neutral"/> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.6.0" newVersion="2.0.6.0"/> <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ComponentModel.Annotations" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>

View File

@ -17,9 +17,6 @@
<!--Global View Model Locator--> <!--Global View Model Locator-->
<viewModels:ViewModelLocator x:Key="Locator" /> <viewModels:ViewModelLocator x:Key="Locator" />
<services:NavigationService x:Key="Navigation" />
<services:ConversionService x:Key="Conversions" />
<services:SettingsService x:Key="Settings" />
<services:UpgradeService x:Key="Upgrade" /> <services:UpgradeService x:Key="Upgrade" />
<!-- Markdown style --> <!-- Markdown style -->

View File

@ -22,12 +22,13 @@ namespace FileConverter
using System.Threading; using System.Threading;
using System.Windows; using System.Windows;
using CommunityToolkit.Mvvm.DependencyInjection;
using FileConverter.ConversionJobs; using FileConverter.ConversionJobs;
using FileConverter.Services; using FileConverter.Services;
using FileConverter.ViewModels;
using FileConverter.Views; using FileConverter.Views;
using Microsoft.Extensions.DependencyInjection;
using GalaSoft.MvvmLight.Ioc;
using Debug = FileConverter.Diagnostics.Debug; using Debug = FileConverter.Diagnostics.Debug;
public partial class Application : System.Windows.Application public partial class Application : System.Windows.Application
@ -77,7 +78,7 @@ namespace FileConverter
this.Initialize(); this.Initialize();
// Navigate to the wanted view. // Navigate to the wanted view.
INavigationService navigationService = SimpleIoc.Default.GetInstance<INavigationService>(); INavigationService navigationService = Ioc.Default.GetRequiredService<INavigationService>();
if (this.showHelp) if (this.showHelp)
{ {
@ -89,7 +90,7 @@ namespace FileConverter
{ {
navigationService.Show(Pages.Main); navigationService.Show(Pages.Main);
IConversionService conversionService = SimpleIoc.Default.GetInstance<IConversionService>(); IConversionService conversionService = Ioc.Default.GetRequiredService<IConversionService>();
conversionService.ConversionJobsTerminated += this.ConversionService_ConversionJobsTerminated; conversionService.ConversionJobsTerminated += this.ConversionService_ConversionJobsTerminated;
conversionService.ConvertFilesAsync(); conversionService.ConvertFilesAsync();
} }
@ -111,7 +112,7 @@ namespace FileConverter
Debug.Log("Exit application."); Debug.Log("Exit application.");
IUpgradeService upgradeService = SimpleIoc.Default.GetInstance<IUpgradeService>(); IUpgradeService upgradeService = Ioc.Default.GetRequiredService<IUpgradeService>();
if (!this.isSessionEnding && upgradeService.UpgradeVersionDescription != null && upgradeService.UpgradeVersionDescription.NeedToUpgrade) if (!this.isSessionEnding && upgradeService.UpgradeVersionDescription != null && upgradeService.UpgradeVersionDescription.NeedToUpgrade)
{ {
@ -161,37 +162,36 @@ namespace FileConverter
private void RegisterServices() private void RegisterServices()
{ {
if (this.TryFindResource("Settings") == null) var services = new ServiceCollection();
{
Debug.LogError("Can't retrieve conversion service.");
this.Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown()));
}
if (this.TryFindResource("Locator") == null) if (this.TryFindResource("Locator") is ViewModelLocator viewModelLocator)
{
viewModelLocator.RegisterViewModels(services);
}
else
{ {
Debug.LogError("Can't retrieve view model locator."); Debug.LogError("Can't retrieve view model locator.");
this.Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown())); this.Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown()));
} }
if (this.TryFindResource("Conversions") == null) if (this.TryFindResource("Upgrade") is UpgradeService upgradeService)
{ {
Debug.LogError("Can't retrieve conversion service."); services.AddSingleton<IUpgradeService>(upgradeService);
}
else
{
Debug.LogError("Can't retrieve Upgrade service.");
this.Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown())); this.Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown()));
} }
if (this.TryFindResource("Navigation") == null) services
{ .AddSingleton<INavigationService, NavigationService>()
Debug.LogError("Can't retrieve navigation service."); .AddSingleton<IConversionService, ConversionService>()
this.Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown())); .AddSingleton<ISettingsService, SettingsService>();
}
if (this.TryFindResource("Upgrade") == null) Ioc.Default.ConfigureServices(services.BuildServiceProvider());
{
Debug.LogError("Can't retrieve navigation service.");
this.Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown()));
}
INavigationService navigationService = SimpleIoc.Default.GetInstance<INavigationService>(); INavigationService navigationService = Ioc.Default.GetRequiredService<INavigationService>();
navigationService.RegisterPage<HelpWindow>(Pages.Help, false, true); navigationService.RegisterPage<HelpWindow>(Pages.Help, false, true);
navigationService.RegisterPage<MainWindow>(Pages.Main, false, true); navigationService.RegisterPage<MainWindow>(Pages.Main, false, true);
@ -228,7 +228,7 @@ namespace FileConverter
return; return;
} }
ISettingsService settingsService = SimpleIoc.Default.GetInstance<ISettingsService>(); ISettingsService settingsService = Ioc.Default.GetRequiredService<ISettingsService>();
// Parse arguments. // Parse arguments.
bool quitAfterStartup = false; bool quitAfterStartup = false;
@ -364,7 +364,7 @@ namespace FileConverter
// Check for upgrade. // Check for upgrade.
if (settingsService.Settings.CheckUpgradeAtStartup) if (settingsService.Settings.CheckUpgradeAtStartup)
{ {
IUpgradeService upgradeService = SimpleIoc.Default.GetInstance<IUpgradeService>(); IUpgradeService upgradeService = Ioc.Default.GetRequiredService<IUpgradeService>();
upgradeService.NewVersionAvailable += this.UpgradeService_NewVersionAvailable; upgradeService.NewVersionAvailable += this.UpgradeService_NewVersionAvailable;
upgradeService.CheckForUpgrade(); upgradeService.CheckForUpgrade();
} }
@ -383,7 +383,7 @@ namespace FileConverter
if (conversionPreset != null) if (conversionPreset != null)
{ {
IConversionService conversionService = SimpleIoc.Default.GetInstance<IConversionService>(); IConversionService conversionService = Ioc.Default.GetRequiredService<IConversionService>();
// Create conversion jobs. // Create conversion jobs.
Debug.Log("Create jobs for conversion preset: '{0}'", conversionPreset.FullName); Debug.Log("Create jobs for conversion preset: '{0}'", conversionPreset.FullName);
@ -409,18 +409,18 @@ namespace FileConverter
private void UpgradeService_NewVersionAvailable(object sender, UpgradeVersionDescription e) private void UpgradeService_NewVersionAvailable(object sender, UpgradeVersionDescription e)
{ {
SimpleIoc.Default.GetInstance<INavigationService>().Show(Pages.Upgrade); Ioc.Default.GetRequiredService<INavigationService>().Show(Pages.Upgrade);
IUpgradeService upgradeService = SimpleIoc.Default.GetInstance<IUpgradeService>(); IUpgradeService upgradeService = Ioc.Default.GetRequiredService<IUpgradeService>();
upgradeService.NewVersionAvailable -= this.UpgradeService_NewVersionAvailable; upgradeService.NewVersionAvailable -= this.UpgradeService_NewVersionAvailable;
} }
private void ConversionService_ConversionJobsTerminated(object sender, ConversionJobsTerminatedEventArgs e) private void ConversionService_ConversionJobsTerminated(object sender, ConversionJobsTerminatedEventArgs e)
{ {
IConversionService conversionService = SimpleIoc.Default.GetInstance<IConversionService>(); IConversionService conversionService = Ioc.Default.GetRequiredService<IConversionService>();
conversionService.ConversionJobsTerminated -= this.ConversionService_ConversionJobsTerminated; conversionService.ConversionJobsTerminated -= this.ConversionService_ConversionJobsTerminated;
ISettingsService settingsService = SimpleIoc.Default.GetInstance<ISettingsService>(); ISettingsService settingsService = Ioc.Default.GetRequiredService<ISettingsService>();
if (!settingsService.Settings.ExitApplicationWhenConversionsFinished) if (!settingsService.Settings.ExitApplicationWhenConversionsFinished)
{ {

View File

@ -6,11 +6,11 @@ namespace FileConverter.ConversionJobs
using System.ComponentModel; using System.ComponentModel;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Windows.Input; using System.Windows.Input;
using CommunityToolkit.Mvvm.Input;
using FileConverter.Diagnostics; using FileConverter.Diagnostics;
using GalaSoft.MvvmLight.Command;
public class ConversionJob : INotifyPropertyChanged public class ConversionJob : INotifyPropertyChanged
{ {
private float progress = 0f; private float progress = 0f;
@ -192,7 +192,7 @@ namespace FileConverter.ConversionJobs
} }
} }
protected virtual bool IsCancelable => this.State == ConversionState.InProgress; protected virtual bool IsCancelable() => this.State == ConversionState.InProgress;
protected string[] OutputFilePaths protected string[] OutputFilePaths
{ {
@ -363,7 +363,7 @@ namespace FileConverter.ConversionJobs
public virtual void Cancel() public virtual void Cancel()
{ {
if (!this.IsCancelable) if (!this.IsCancelable())
{ {
return; return;
} }

View File

@ -28,7 +28,7 @@ namespace FileConverter.ConversionJobs
protected override ApplicationName Application => ApplicationName.Excel; protected override ApplicationName Application => ApplicationName.Excel;
protected override bool IsCancelable => false; protected override bool IsCancelable() => false;
protected override int GetOutputFilesCount() protected override int GetOutputFilesCount()
{ {

View File

@ -26,7 +26,7 @@ namespace FileConverter.ConversionJobs
get; get;
} }
protected override bool IsCancelable => false; protected override bool IsCancelable() => false;
protected override void Initialize() protected override void Initialize()
{ {

View File

@ -29,7 +29,7 @@ namespace FileConverter.ConversionJobs
protected override ApplicationName Application => ApplicationName.PowerPoint; protected override ApplicationName Application => ApplicationName.PowerPoint;
protected override bool IsCancelable => false; protected override bool IsCancelable() => false;
protected override int GetOutputFilesCount() protected override int GetOutputFilesCount()
{ {

View File

@ -28,7 +28,7 @@ namespace FileConverter.ConversionJobs
protected override ApplicationName Application => ApplicationName.Word; protected override ApplicationName Application => ApplicationName.Word;
protected override bool IsCancelable => false; protected override bool IsCancelable() => false;
protected override int GetOutputFilesCount() protected override int GetOutputFilesCount()
{ {

View File

@ -6,11 +6,11 @@ namespace FileConverter
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.Xml.Serialization; using System.Xml.Serialization;
using CommunityToolkit.Mvvm.ComponentModel;
using FileConverter.Controls; using FileConverter.Controls;
using GalaSoft.MvvmLight;
[XmlRoot] [XmlRoot]
[XmlType] [XmlType]
public class ConversionPreset : ObservableObject, IXmlSerializable public class ConversionPreset : ObservableObject, IXmlSerializable
@ -109,7 +109,7 @@ namespace FileConverter
set set
{ {
this.shortName = value; this.shortName = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }
@ -129,7 +129,7 @@ namespace FileConverter
{ {
this.outputType = value; this.outputType = value;
this.InitializeDefaultSettings(this.outputType); this.InitializeDefaultSettings(this.outputType);
this.RaisePropertyChanged(); this.OnPropertyChanged();
this.CoerceInputTypes(); this.CoerceInputTypes();
} }
} }
@ -157,7 +157,7 @@ namespace FileConverter
this.inputTypes[index] = this.inputTypes[index].ToLowerInvariant(); this.inputTypes[index] = this.inputTypes[index].ToLowerInvariant();
} }
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }
@ -172,7 +172,7 @@ namespace FileConverter
set set
{ {
this.inputPostConversionAction = value; this.inputPostConversionAction = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }
@ -216,7 +216,7 @@ namespace FileConverter
} }
} }
this.RaisePropertyChanged(nameof(this.Settings)); this.OnPropertyChanged(nameof(this.Settings));
} }
} }
@ -231,7 +231,7 @@ namespace FileConverter
set set
{ {
this.outputFileNameTemplate = value; this.outputFileNameTemplate = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }
@ -268,7 +268,7 @@ namespace FileConverter
} }
} }
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }
@ -308,14 +308,14 @@ namespace FileConverter
} }
this.inputTypes.Add(inputType); this.inputTypes.Add(inputType);
this.RaisePropertyChanged(nameof(this.InputTypes)); this.OnPropertyChanged(nameof(this.InputTypes));
} }
public void RemoveInputType(string inputType) public void RemoveInputType(string inputType)
{ {
if (this.inputTypes.Remove(inputType)) if (this.inputTypes.Remove(inputType))
{ {
this.RaisePropertyChanged(nameof(this.InputTypes)); this.OnPropertyChanged(nameof(this.InputTypes));
} }
} }
@ -348,7 +348,7 @@ namespace FileConverter
this.settings[settingsKey] = value; this.settings[settingsKey] = value;
this.RaisePropertyChanged(nameof(this.Settings)); this.OnPropertyChanged(nameof(this.Settings));
} }
public string GetSettingsValue(string settingsKey) public string GetSettingsValue(string settingsKey)
@ -544,7 +544,7 @@ namespace FileConverter
throw new System.Exception("Missing default settings for type " + outputType); throw new System.Exception("Missing default settings for type " + outputType);
} }
this.RaisePropertyChanged(nameof(this.Settings)); this.OnPropertyChanged(nameof(this.Settings));
} }
private void InitializeSettingsValue(string settingsKey, string value, bool force = false) private void InitializeSettingsValue(string settingsKey, string value, bool force = false)

View File

@ -69,18 +69,8 @@
<Prefer32Bit>true</Prefer32Bit> <Prefer32Bit>true</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="CommonServiceLocator, Version=2.0.7.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL"> <Reference Include="CommunityToolkit.Mvvm, Version=8.2.0.0, Culture=neutral, PublicKeyToken=4aff67a105548ee2, processorArchitecture=MSIL">
<HintPath>..\..\packages\CommonServiceLocator.2.0.7\lib\net48\CommonServiceLocator.dll</HintPath> <HintPath>..\..\packages\CommunityToolkit.Mvvm.8.2.2\lib\netstandard2.0\CommunityToolkit.Mvvm.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="GalaSoft.MvvmLight, Version=5.4.1.0, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
<HintPath>..\..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Extras, Version=5.4.1.0, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL">
<HintPath>..\..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Platform, Version=5.4.1.0, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
<HintPath>..\..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
</Reference> </Reference>
<Reference Include="Magick.NET-Q16-AnyCPU, Version=13.5.0.0, Culture=neutral, PublicKeyToken=2004825badfa91ec, processorArchitecture=MSIL"> <Reference Include="Magick.NET-Q16-AnyCPU, Version=13.5.0.0, Culture=neutral, PublicKeyToken=2004825badfa91ec, processorArchitecture=MSIL">
<HintPath>..\..\packages\Magick.NET-Q16-AnyCPU.13.5.0\lib\netstandard20\Magick.NET-Q16-AnyCPU.dll</HintPath> <HintPath>..\..\packages\Magick.NET-Q16-AnyCPU.13.5.0\lib\netstandard20\Magick.NET-Q16-AnyCPU.dll</HintPath>
@ -93,6 +83,15 @@
<Reference Include="Markdown.Xaml"> <Reference Include="Markdown.Xaml">
<HintPath>..\..\Middleware\Markdown.Xaml.dll</HintPath> <HintPath>..\..\Middleware\Markdown.Xaml.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.DependencyInjection, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Extensions.DependencyInjection.8.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.8.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL"> <Reference Include="Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Office.Interop.Excel.15.0.4795.1000\lib\net20\Microsoft.Office.Interop.Excel.dll</HintPath> <HintPath>..\..\packages\Microsoft.Office.Interop.Excel.15.0.4795.1000\lib\net20\Microsoft.Office.Interop.Excel.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes> <EmbedInteropTypes>True</EmbedInteropTypes>
@ -105,6 +104,9 @@
<HintPath>..\..\packages\Microsoft.Office.Interop.Word.15.0.4797.1003\lib\net20\Microsoft.Office.Interop.Word.dll</HintPath> <HintPath>..\..\packages\Microsoft.Office.Interop.Word.15.0.4797.1003\lib\net20\Microsoft.Office.Interop.Word.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes> <EmbedInteropTypes>True</EmbedInteropTypes>
</Reference> </Reference>
<Reference Include="Microsoft.Xaml.Behaviors, Version=1.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Xaml.Behaviors.Wpf.1.1.77\lib\net462\Microsoft.Xaml.Behaviors.dll</HintPath>
</Reference>
<Reference Include="Office, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"> <Reference Include="Office, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
<HintPath>..\..\packages\Office.12.0.0\lib\net40\Office.dll</HintPath> <HintPath>..\..\packages\Office.12.0.0\lib\net40\Office.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes> <EmbedInteropTypes>True</EmbedInteropTypes>
@ -118,12 +120,29 @@
<HintPath>..\..\packages\SharpShell.2.7.2\lib\net40-client\SharpShell.dll</HintPath> <HintPath>..\..\packages\SharpShell.2.7.2\lib\net40-client\SharpShell.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" /> <Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<Reference Include="System.Drawing" /> <HintPath>..\..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\MvvmLightLibs.5.4.1.1\lib\net45\System.Windows.Interactivity.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.ComponentModel.Annotations, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.ComponentModel.Annotations.5.0.0\lib\net461\System.ComponentModel.Annotations.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Drawing" />
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
@ -448,7 +467,9 @@ if %25errorlevel%25 leq 1 exit 0 else exit %25errorlevel%25</PostBuildEvent>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('..\..\packages\Magick.NET-Q16-AnyCPU.13.5.0\build\netstandard20\Magick.NET-Q16-AnyCPU.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Magick.NET-Q16-AnyCPU.13.5.0\build\netstandard20\Magick.NET-Q16-AnyCPU.targets'))" /> <Error Condition="!Exists('..\..\packages\Magick.NET-Q16-AnyCPU.13.5.0\build\netstandard20\Magick.NET-Q16-AnyCPU.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Magick.NET-Q16-AnyCPU.13.5.0\build\netstandard20\Magick.NET-Q16-AnyCPU.targets'))" />
<Error Condition="!Exists('..\..\packages\CommunityToolkit.Mvvm.8.2.2\build\netstandard2.0\CommunityToolkit.Mvvm.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\CommunityToolkit.Mvvm.8.2.2\build\netstandard2.0\CommunityToolkit.Mvvm.targets'))" />
</Target> </Target>
<Import Project="..\..\packages\CommunityToolkit.Mvvm.8.2.2\build\netstandard2.0\CommunityToolkit.Mvvm.targets" Condition="Exists('..\..\packages\CommunityToolkit.Mvvm.8.2.2\build\netstandard2.0\CommunityToolkit.Mvvm.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">

View File

@ -15,9 +15,9 @@ namespace FileConverter
using SharpShell; using SharpShell;
using SharpShell.ServerRegistration; using SharpShell.ServerRegistration;
using GalaSoft.MvvmLight.Ioc;
using Microsoft.Win32; using Microsoft.Win32;
using CommunityToolkit.Mvvm.DependencyInjection;
public static class Helpers public static class Helpers
{ {
@ -243,7 +243,7 @@ namespace FileConverter
public static Thread InstantiateThread(string name, ThreadStart threadStart) public static Thread InstantiateThread(string name, ThreadStart threadStart)
{ {
ISettingsService settingsService = SimpleIoc.Default.GetInstance<ISettingsService>(); ISettingsService settingsService = Ioc.Default.GetRequiredService<ISettingsService>();
CultureInfo currentCulture = settingsService?.Settings?.ApplicationLanguage; CultureInfo currentCulture = settingsService?.Settings?.ApplicationLanguage;
Thread thread = new Thread(threadStart); Thread thread = new Thread(threadStart);
@ -260,7 +260,7 @@ namespace FileConverter
public static Thread InstantiateThread(string name, ParameterizedThreadStart parameterizedThreadStart) public static Thread InstantiateThread(string name, ParameterizedThreadStart parameterizedThreadStart)
{ {
ISettingsService settingsService = SimpleIoc.Default.GetInstance<ISettingsService>(); ISettingsService settingsService = Ioc.Default.GetRequiredService<ISettingsService>();
CultureInfo currentCulture = settingsService?.Settings?.ApplicationLanguage; CultureInfo currentCulture = settingsService?.Settings?.ApplicationLanguage;
Thread thread = new Thread(parameterizedThreadStart); Thread thread = new Thread(parameterizedThreadStart);

View File

@ -7,23 +7,26 @@ namespace FileConverter.Services
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Threading; using System.Threading;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.DependencyInjection;
using FileConverter.ConversionJobs; using FileConverter.ConversionJobs;
using FileConverter.Diagnostics; using FileConverter.Diagnostics;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Ioc;
public class ConversionService : ObservableObject, IConversionService public class ConversionService : ObservableObject, IConversionService
{ {
private readonly List<ConversionJob> conversionJobs = new List<ConversionJob>(); private readonly List<ConversionJob> conversionJobs = new List<ConversionJob>();
private readonly int numberOfConversionThread = 1; private readonly int numberOfConversionThread = 1;
public ConversionService() public ConversionService(ISettingsService settingsService)
{ {
this.ConversionJobs = this.conversionJobs.AsReadOnly(); if (settingsService == null)
{
throw new ArgumentNullException(nameof(settingsService));
}
ISettingsService settingsService = SimpleIoc.Default.GetInstance<ISettingsService>(); this.ConversionJobs = this.conversionJobs.AsReadOnly();
this.numberOfConversionThread = settingsService.Settings.MaximumNumberOfSimultaneousConversions; this.numberOfConversionThread = settingsService.Settings.MaximumNumberOfSimultaneousConversions;
Diagnostics.Debug.Log("Maximum number of conversion threads: {0}", this.numberOfConversionThread); Diagnostics.Debug.Log("Maximum number of conversion threads: {0}", this.numberOfConversionThread);
@ -33,8 +36,6 @@ namespace FileConverter.Services
this.numberOfConversionThread = System.Math.Max(1, Environment.ProcessorCount / 2); this.numberOfConversionThread = System.Math.Max(1, Environment.ProcessorCount / 2);
Diagnostics.Debug.Log("The number of processors on this computer is {0}. Set the default number of conversion threads to {0}", settingsService.Settings.MaximumNumberOfSimultaneousConversions); Diagnostics.Debug.Log("The number of processors on this computer is {0}. Set the default number of conversion threads to {0}", settingsService.Settings.MaximumNumberOfSimultaneousConversions);
} }
SimpleIoc.Default.Register<IConversionService>(() => this);
} }
public event System.EventHandler<ConversionJobsTerminatedEventArgs> ConversionJobsTerminated; public event System.EventHandler<ConversionJobsTerminatedEventArgs> ConversionJobsTerminated;
@ -48,7 +49,7 @@ namespace FileConverter.Services
public void RegisterConversionJob(ConversionJob conversionJob) public void RegisterConversionJob(ConversionJob conversionJob)
{ {
this.conversionJobs.Add(conversionJob); this.conversionJobs.Add(conversionJob);
this.RaisePropertyChanged(nameof(this.ConversionJobs)); this.OnPropertyChanged(nameof(this.ConversionJobs));
} }
public void ConvertFilesAsync() public void ConvertFilesAsync()

View File

@ -6,10 +6,10 @@ namespace FileConverter.Services
using System.Collections.Generic; using System.Collections.Generic;
using System.Windows; using System.Windows;
using FileConverter.Annotations; using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.DependencyInjection;
using GalaSoft.MvvmLight; using FileConverter.Annotations;
using GalaSoft.MvvmLight.Ioc;
using Application = FileConverter.Application; using Application = FileConverter.Application;
@ -21,8 +21,6 @@ namespace FileConverter.Services
public NavigationService() public NavigationService()
{ {
this.pageInfoByType = new Dictionary<string, PageInfo>(); this.pageInfoByType = new Dictionary<string, PageInfo>();
SimpleIoc.Default.Register<INavigationService>(() => this);
} }
public void Show([NotNull] string pageKey) public void Show([NotNull] string pageKey)
@ -104,7 +102,7 @@ namespace FileConverter.Services
// If this is the last window. // If this is the last window.
if (this.numberOfPageShowed == 0) if (this.numberOfPageShowed == 0)
{ {
IUpgradeService upgradeService = SimpleIoc.Default.GetInstance<IUpgradeService>(); IUpgradeService upgradeService = Ioc.Default.GetRequiredService<IUpgradeService>();
bool upgradeInProgress = upgradeService.UpgradeVersionDescription != null && bool upgradeInProgress = upgradeService.UpgradeVersionDescription != null &&
upgradeService.UpgradeVersionDescription.NeedToUpgrade && upgradeService.UpgradeVersionDescription.NeedToUpgrade &&
!upgradeService.UpgradeVersionDescription.InstallerDownloadDone; !upgradeService.UpgradeVersionDescription.InstallerDownloadDone;
@ -118,7 +116,7 @@ namespace FileConverter.Services
} }
else else
{ {
INavigationService navigationService = SimpleIoc.Default.GetInstance<INavigationService>(); INavigationService navigationService = Ioc.Default.GetRequiredService<INavigationService>();
navigationService.Show(Pages.Upgrade); navigationService.Show(Pages.Upgrade);
Diagnostics.Debug.Log("There is an upgrade in progress, display the upgrade window."); Diagnostics.Debug.Log("There is an upgrade in progress, display the upgrade window.");
} }

View File

@ -9,8 +9,7 @@ namespace FileConverter.Services
using System.IO; using System.IO;
using System.Windows; using System.Windows;
using GalaSoft.MvvmLight; using CommunityToolkit.Mvvm.ComponentModel;
using GalaSoft.MvvmLight.Ioc;
using Debug = FileConverter.Diagnostics.Debug; using Debug = FileConverter.Diagnostics.Debug;
@ -21,8 +20,6 @@ namespace FileConverter.Services
// Load settigns. // Load settigns.
Debug.Log("Load settings..."); Debug.Log("Load settings...");
this.Settings = this.Load(); this.Settings = this.Load();
SimpleIoc.Default.Register<ISettingsService>(() => this);
} }
public Settings Settings public Settings Settings

View File

@ -3,7 +3,6 @@
namespace FileConverter.Services namespace FileConverter.Services
{ {
using System; using System;
using System.ComponentModel;
using System.IO; using System.IO;
using System.Net; using System.Net;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
@ -11,12 +10,11 @@ namespace FileConverter.Services
using System.Xml; using System.Xml;
using System.Xml.Serialization; using System.Xml.Serialization;
using CommunityToolkit.Mvvm.ComponentModel;
using FileConverter.Annotations; using FileConverter.Annotations;
using FileConverter.Diagnostics; using FileConverter.Diagnostics;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Ioc;
public class UpgradeService : ObservableObject, IUpgradeService public class UpgradeService : ObservableObject, IUpgradeService
{ {
#if DEBUG #if DEBUG
@ -33,7 +31,6 @@ namespace FileConverter.Services
public UpgradeService() public UpgradeService()
{ {
this.UpgradeVersionDescription = new UpgradeVersionDescription(); this.UpgradeVersionDescription = new UpgradeVersionDescription();
SimpleIoc.Default.Register<IUpgradeService>(() => this);
} }
public event EventHandler<UpgradeVersionDescription> NewVersionAvailable; public event EventHandler<UpgradeVersionDescription> NewVersionAvailable;
@ -44,7 +41,7 @@ namespace FileConverter.Services
private set private set
{ {
this.upgradeVersionDescription = value; this.upgradeVersionDescription = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }

View File

@ -4,7 +4,7 @@ namespace FileConverter.Services
{ {
using System.Xml.Serialization; using System.Xml.Serialization;
using GalaSoft.MvvmLight; using CommunityToolkit.Mvvm.ComponentModel;
public class UpgradeVersionDescription : ObservableObject public class UpgradeVersionDescription : ObservableObject
{ {
@ -34,7 +34,7 @@ namespace FileConverter.Services
set set
{ {
this.changeLog = value; this.changeLog = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }
@ -53,9 +53,9 @@ namespace FileConverter.Services
set set
{ {
this.installerDownloadInProgress = value; this.installerDownloadInProgress = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
this.RaisePropertyChanged(nameof(this.InstallerDownloadDone)); this.OnPropertyChanged(nameof(this.InstallerDownloadDone));
this.RaisePropertyChanged(nameof(this.InstallerDownloadNotStarted)); this.OnPropertyChanged(nameof(this.InstallerDownloadNotStarted));
} }
} }
@ -67,9 +67,9 @@ namespace FileConverter.Services
set set
{ {
this.installerDownloadProgress = value; this.installerDownloadProgress = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
this.RaisePropertyChanged(nameof(this.InstallerDownloadDone)); this.OnPropertyChanged(nameof(this.InstallerDownloadDone));
this.RaisePropertyChanged(nameof(this.InstallerDownloadNotStarted)); this.OnPropertyChanged(nameof(this.InstallerDownloadNotStarted));
} }
} }

View File

@ -2,13 +2,12 @@
namespace FileConverter namespace FileConverter
{ {
using System.ComponentModel;
using System.Linq; using System.Linq;
using System.Xml.Serialization; using System.Xml.Serialization;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Globalization; using System.Globalization;
using GalaSoft.MvvmLight; using CommunityToolkit.Mvvm.ComponentModel;
[XmlRoot] [XmlRoot]
[XmlType] [XmlType]
@ -86,7 +85,7 @@ namespace FileConverter
System.Threading.Thread.CurrentThread.CurrentUICulture = this.applicationLanguage; System.Threading.Thread.CurrentThread.CurrentUICulture = this.applicationLanguage;
} }
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }
@ -126,7 +125,7 @@ namespace FileConverter
set set
{ {
this.conversionPresets = value; this.conversionPresets = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }
@ -141,7 +140,7 @@ namespace FileConverter
set set
{ {
this.exitApplicationWhenConversionsFinished = value; this.exitApplicationWhenConversionsFinished = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }
@ -156,7 +155,7 @@ namespace FileConverter
set set
{ {
this.durationBetweenEndOfConversionsAndApplicationExit = value; this.durationBetweenEndOfConversionsAndApplicationExit = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }
@ -171,7 +170,7 @@ namespace FileConverter
set set
{ {
this.maximumNumberOfSimultaneousConversions = value; this.maximumNumberOfSimultaneousConversions = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }
@ -203,7 +202,7 @@ namespace FileConverter
set set
{ {
this.checkUpgradeAtStartup = value; this.checkUpgradeAtStartup = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }

View File

@ -7,8 +7,8 @@ namespace FileConverter.ValueConverters
using System.Linq; using System.Linq;
using System.Windows.Data; using System.Windows.Data;
using CommonServiceLocator; using CommunityToolkit.Mvvm.DependencyInjection;
using FileConverter.ViewModels; using FileConverter.ViewModels;
public class OutputTypeEnumToViewModel : IValueConverter public class OutputTypeEnumToViewModel : IValueConverter
@ -22,7 +22,7 @@ namespace FileConverter.ValueConverters
OutputType outputType = (OutputType)value; OutputType outputType = (OutputType)value;
SettingsViewModel settingsViewModel = ServiceLocator.Current.GetInstance<SettingsViewModel>(); SettingsViewModel settingsViewModel = Ioc.Default.GetRequiredService<SettingsViewModel>();
return settingsViewModel.OutputTypes.Cast<OutputTypeViewModel>() return settingsViewModel.OutputTypes.Cast<OutputTypeViewModel>()
.FirstOrDefault(match => match.Type == outputType); .FirstOrDefault(match => match.Type == outputType);

View File

@ -5,25 +5,16 @@ namespace FileConverter.ViewModels
using System.ComponentModel; using System.ComponentModel;
using System.Windows.Input; using System.Windows.Input;
using FileConverter.Services; using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.DependencyInjection;
using CommunityToolkit.Mvvm.Input;
using GalaSoft.MvvmLight; using FileConverter.Services;
using GalaSoft.MvvmLight.Command;
using GalaSoft.MvvmLight.Ioc;
/// <summary> /// <summary>
/// This class contains properties that the diagnostics View can data bind to. /// This class contains properties that the diagnostics View can data bind to.
/// <para>
/// Use the <strong>mvvminpc</strong> snippet to add bindable properties to this ViewModel.
/// </para>
/// <para>
/// You can also use Blend to data bind with the tool's support.
/// </para>
/// <para>
/// See http://www.galasoft.ch/mvvm
/// </para>
/// </summary> /// </summary>
public class DiagnosticsViewModel : ViewModelBase public class DiagnosticsViewModel : ObservableRecipient
{ {
private RelayCommand<CancelEventArgs> closeCommand; private RelayCommand<CancelEventArgs> closeCommand;
@ -32,13 +23,6 @@ namespace FileConverter.ViewModels
/// </summary> /// </summary>
public DiagnosticsViewModel() public DiagnosticsViewModel()
{ {
if (this.IsInDesignMode)
{
// Code runs in Blend --> create design time data.
}
else
{
}
} }
public ICommand CloseCommand public ICommand CloseCommand
@ -56,7 +40,7 @@ namespace FileConverter.ViewModels
private void Close(CancelEventArgs args) private void Close(CancelEventArgs args)
{ {
INavigationService navigationService = SimpleIoc.Default.GetInstance<INavigationService>(); INavigationService navigationService = Ioc.Default.GetRequiredService<INavigationService>();
navigationService.Close(Pages.Diagnostics, args != null); navigationService.Close(Pages.Diagnostics, args != null);
} }
} }

View File

@ -5,25 +5,16 @@ namespace FileConverter.ViewModels
using System.ComponentModel; using System.ComponentModel;
using System.Windows.Input; using System.Windows.Input;
using FileConverter.Services; using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.DependencyInjection;
using CommunityToolkit.Mvvm.Input;
using GalaSoft.MvvmLight; using FileConverter.Services;
using GalaSoft.MvvmLight.Command;
using GalaSoft.MvvmLight.Ioc;
/// <summary> /// <summary>
/// This class contains properties that the main View can data bind to. /// This class contains properties that the main View can data bind to.
/// <para>
/// Use the <strong>mvvminpc</strong> snippet to add bindable properties to this ViewModel.
/// </para>
/// <para>
/// You can also use Blend to data bind with the tool's support.
/// </para>
/// <para>
/// See http://www.galasoft.ch/mvvm
/// </para>
/// </summary> /// </summary>
public class HelpViewModel : ViewModelBase public class HelpViewModel : ObservableRecipient
{ {
private RelayCommand<CancelEventArgs> closeCommand; private RelayCommand<CancelEventArgs> closeCommand;
@ -32,13 +23,6 @@ namespace FileConverter.ViewModels
/// </summary> /// </summary>
public HelpViewModel() public HelpViewModel()
{ {
if (this.IsInDesignMode)
{
// Code runs in Blend --> create design time data.
}
else
{
}
} }
public ICommand CloseCommand public ICommand CloseCommand
@ -56,7 +40,7 @@ namespace FileConverter.ViewModels
private void Close(CancelEventArgs args) private void Close(CancelEventArgs args)
{ {
INavigationService navigationService = SimpleIoc.Default.GetInstance<INavigationService>(); INavigationService navigationService = Ioc.Default.GetRequiredService<INavigationService>();
navigationService.Close(Pages.Help, args != null); navigationService.Close(Pages.Help, args != null);
} }
} }

View File

@ -4,10 +4,9 @@ namespace FileConverter.ViewModels
{ {
using System.Windows.Media; using System.Windows.Media;
using CommonServiceLocator; using CommunityToolkit.Mvvm.ComponentModel;
using GalaSoft.MvvmLight; using CommunityToolkit.Mvvm.DependencyInjection;
using FileConverter.Annotations;
using FileConverter.ConversionJobs; using FileConverter.ConversionJobs;
public class InputExtension : ObservableObject public class InputExtension : ObservableObject
@ -56,7 +55,7 @@ namespace FileConverter.ViewModels
set set
{ {
this.name = value; this.name = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }
@ -67,7 +66,7 @@ namespace FileConverter.ViewModels
set set
{ {
this.foregroundBrush = value; this.foregroundBrush = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }
@ -78,7 +77,7 @@ namespace FileConverter.ViewModels
set set
{ {
this.toolTip = value; this.toolTip = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }
@ -86,7 +85,7 @@ namespace FileConverter.ViewModels
{ {
get get
{ {
SettingsViewModel settingsViewModel = ServiceLocator.Current.GetInstance<SettingsViewModel>(); SettingsViewModel settingsViewModel = Ioc.Default.GetRequiredService<SettingsViewModel>();
PresetNode selectedPreset = settingsViewModel.SelectedPreset; PresetNode selectedPreset = settingsViewModel.SelectedPreset;
if (selectedPreset == null) if (selectedPreset == null)
{ {
@ -98,7 +97,7 @@ namespace FileConverter.ViewModels
set set
{ {
SettingsViewModel settingsViewModel = ServiceLocator.Current.GetInstance<SettingsViewModel>(); SettingsViewModel settingsViewModel = Ioc.Default.GetRequiredService<SettingsViewModel>();
PresetNode selectedPreset = settingsViewModel.SelectedPreset; PresetNode selectedPreset = settingsViewModel.SelectedPreset;
if (value) if (value)
@ -110,8 +109,13 @@ namespace FileConverter.ViewModels
selectedPreset?.Preset.RemoveInputType(this.name.ToLowerInvariant()); selectedPreset?.Preset.RemoveInputType(this.name.ToLowerInvariant());
} }
this.RaisePropertyChanged(nameof(this.IsChecked)); this.OnPropertyChanged(nameof(this.IsChecked));
} }
} }
internal void OnCategoryChanged()
{
this.OnPropertyChanged(nameof(this.IsChecked));
}
} }
} }

View File

@ -2,11 +2,12 @@
namespace FileConverter.ViewModels namespace FileConverter.ViewModels
{ {
using CommonServiceLocator;
using GalaSoft.MvvmLight;
using System.ComponentModel; using System.ComponentModel;
using System.Collections.Generic; using System.Collections.Generic;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.DependencyInjection;
public class InputExtensionCategory : ObservableObject public class InputExtensionCategory : ObservableObject
{ {
private readonly List<InputExtension> inputExtensions = new List<InputExtension>(); private readonly List<InputExtension> inputExtensions = new List<InputExtension>();
@ -24,7 +25,7 @@ namespace FileConverter.ViewModels
set set
{ {
this.name = value; this.name = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }
@ -51,9 +52,9 @@ namespace FileConverter.ViewModels
inputExtension.PropertyChanged += this.OnExtensionPropertyChange; inputExtension.PropertyChanged += this.OnExtensionPropertyChange;
this.RaisePropertyChanged(nameof(this.InputExtensions)); this.OnPropertyChanged(nameof(this.InputExtensions));
this.RaisePropertyChanged(nameof(this.InputExtensionNames)); this.OnPropertyChanged(nameof(this.InputExtensionNames));
this.RaisePropertyChanged(nameof(this.IsChecked)); this.OnPropertyChanged(nameof(this.IsChecked));
} }
} }
@ -61,7 +62,7 @@ namespace FileConverter.ViewModels
{ {
get get
{ {
SettingsViewModel settingsViewModel = ServiceLocator.Current.GetInstance<SettingsViewModel>(); SettingsViewModel settingsViewModel = Ioc.Default.GetRequiredService<SettingsViewModel>();
PresetNode selectedPreset = settingsViewModel.SelectedPreset; PresetNode selectedPreset = settingsViewModel.SelectedPreset;
if (selectedPreset == null) if (selectedPreset == null)
{ {
@ -91,7 +92,7 @@ namespace FileConverter.ViewModels
set set
{ {
SettingsViewModel settingsViewModel = ServiceLocator.Current.GetInstance<SettingsViewModel>(); SettingsViewModel settingsViewModel = Ioc.Default.GetRequiredService<SettingsViewModel>();
PresetNode selectedPreset = settingsViewModel.SelectedPreset; PresetNode selectedPreset = settingsViewModel.SelectedPreset;
foreach (string extension in this.InputExtensionNames) foreach (string extension in this.InputExtensionNames)
@ -109,16 +110,16 @@ namespace FileConverter.ViewModels
// Raise property change for extensions. // Raise property change for extensions.
foreach (InputExtension inputExtension in this.InputExtensions) foreach (InputExtension inputExtension in this.InputExtensions)
{ {
inputExtension.RaisePropertyChanged(nameof(inputExtension.IsChecked)); inputExtension.OnCategoryChanged();
} }
this.RaisePropertyChanged(nameof(this.IsChecked)); this.OnPropertyChanged(nameof(this.IsChecked));
} }
} }
private void OnExtensionPropertyChange(object sender, PropertyChangedEventArgs e) private void OnExtensionPropertyChange(object sender, PropertyChangedEventArgs e)
{ {
this.RaisePropertyChanged(nameof(this.IsChecked)); this.OnPropertyChanged(nameof(this.IsChecked));
} }
} }
} }

View File

@ -6,26 +6,17 @@ namespace FileConverter.ViewModels
using System.ComponentModel; using System.ComponentModel;
using System.Windows.Input; using System.Windows.Input;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.DependencyInjection;
using CommunityToolkit.Mvvm.Input;
using FileConverter.ConversionJobs; using FileConverter.ConversionJobs;
using FileConverter.Services; using FileConverter.Services;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using GalaSoft.MvvmLight.Ioc;
/// <summary> /// <summary>
/// This class contains properties that the main View can data bind to. /// This class contains properties that the main View can data bind to.
/// <para>
/// Use the <strong>mvvminpc</strong> snippet to add bindable properties to this ViewModel.
/// </para>
/// <para>
/// You can also use Blend to data bind with the tool's support.
/// </para>
/// <para>
/// See http://www.galasoft.ch/mvvm
/// </para>
/// </summary> /// </summary>
public class MainViewModel : ViewModelBase public class MainViewModel : ObservableRecipient
{ {
private string informationMessage; private string informationMessage;
private ObservableCollection<ConversionJob> conversionJobs; private ObservableCollection<ConversionJob> conversionJobs;
@ -39,21 +30,11 @@ namespace FileConverter.ViewModels
/// </summary> /// </summary>
public MainViewModel() public MainViewModel()
{ {
if (this.IsInDesignMode) IConversionService settingsService = Ioc.Default.GetRequiredService<IConversionService>();
{ this.ConversionJobs = new ObservableCollection<ConversionJob>(settingsService.ConversionJobs);
// Code runs in Blend --> create design time data.
this.InformationMessage = "Design time mode.";
this.ConversionJobs = new ObservableCollection<ConversionJob>();
//this.ConversionJobs.Add(new ConversionJob());
}
else
{
IConversionService settingsService = SimpleIoc.Default.GetInstance<IConversionService>();
this.ConversionJobs = new ObservableCollection<ConversionJob>(settingsService.ConversionJobs);
Application application = Application.Current as Application; Application application = Application.Current as Application;
application.OnApplicationTerminate += this.Application_OnApplicationTerminate; application.OnApplicationTerminate += this.Application_OnApplicationTerminate;
}
} }
public string InformationMessage public string InformationMessage
@ -62,7 +43,7 @@ namespace FileConverter.ViewModels
private set private set
{ {
this.Set(ref this.informationMessage, value); this.SetProperty(ref this.informationMessage, value);
} }
} }
@ -72,7 +53,7 @@ namespace FileConverter.ViewModels
private set private set
{ {
this.Set(ref this.conversionJobs, value); this.SetProperty(ref this.conversionJobs, value);
foreach (var job in this.conversionJobs) foreach (var job in this.conversionJobs)
{ {
@ -87,7 +68,7 @@ namespace FileConverter.ViewModels
{ {
if (this.showSettingsCommand == null) if (this.showSettingsCommand == null)
{ {
this.showSettingsCommand = new RelayCommand(() => SimpleIoc.Default.GetInstance<INavigationService>().Show(Pages.Settings)); this.showSettingsCommand = new RelayCommand(() => Ioc.Default.GetRequiredService<INavigationService>().Show(Pages.Settings));
} }
return this.showSettingsCommand; return this.showSettingsCommand;
@ -100,7 +81,7 @@ namespace FileConverter.ViewModels
{ {
if (this.showDiagnosticsCommand == null) if (this.showDiagnosticsCommand == null)
{ {
this.showDiagnosticsCommand = new RelayCommand(() => SimpleIoc.Default.GetInstance<INavigationService>().Show(Pages.Diagnostics)); this.showDiagnosticsCommand = new RelayCommand(() => Ioc.Default.GetRequiredService<INavigationService>().Show(Pages.Diagnostics));
} }
return this.showDiagnosticsCommand; return this.showDiagnosticsCommand;
@ -122,7 +103,7 @@ namespace FileConverter.ViewModels
private void Close(CancelEventArgs args) private void Close(CancelEventArgs args)
{ {
INavigationService navigationService = SimpleIoc.Default.GetInstance<INavigationService>(); INavigationService navigationService = Ioc.Default.GetRequiredService<INavigationService>();
navigationService.Close(Pages.Main, args != null); navigationService.Close(Pages.Main, args != null);
} }
@ -133,7 +114,7 @@ namespace FileConverter.ViewModels
return; return;
} }
this.RaisePropertyChanged(nameof(this.ConversionJobs)); this.OnPropertyChanged(nameof(this.ConversionJobs));
} }
private void Application_OnApplicationTerminate(object sender, ApplicationTerminateArgs eventArgs) private void Application_OnApplicationTerminate(object sender, ApplicationTerminateArgs eventArgs)

View File

@ -1,12 +1,13 @@
// <copyright file="PresetNode.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright> // <copyright file="PresetNode.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using GalaSoft.MvvmLight;
namespace FileConverter.ViewModels namespace FileConverter.ViewModels
{ {
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using CommunityToolkit.Mvvm.ComponentModel;
public abstract class AbstractTreeNode : ObservableObject, IDataErrorInfo public abstract class AbstractTreeNode : ObservableObject, IDataErrorInfo
{ {
private PresetFolderNode parent; private PresetFolderNode parent;
@ -28,7 +29,7 @@ namespace FileConverter.ViewModels
set set
{ {
this.parent = value; this.parent = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }
@ -135,8 +136,8 @@ namespace FileConverter.ViewModels
set set
{ {
this.Preset.ShortName = value; this.Preset.ShortName = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
this.RaisePropertyChanged(nameof(this.HasError)); this.OnPropertyChanged(nameof(this.HasError));
} }
} }
@ -147,7 +148,7 @@ namespace FileConverter.ViewModels
set set
{ {
this.Preset.OutputFileNameTemplate = value; this.Preset.OutputFileNameTemplate = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }
@ -255,8 +256,8 @@ namespace FileConverter.ViewModels
set set
{ {
this.name = value; this.name = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
this.RaisePropertyChanged(nameof(this.HasError)); this.OnPropertyChanged(nameof(this.HasError));
} }
} }
@ -267,7 +268,7 @@ namespace FileConverter.ViewModels
set set
{ {
this.children = value; this.children = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }

View File

@ -9,34 +9,23 @@ namespace FileConverter.ViewModels
using System.Diagnostics; using System.Diagnostics;
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
using System.Windows;
using System.Windows.Data; using System.Windows.Data;
using System.Windows.Input; using System.Windows.Input;
using Microsoft.Win32;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.DependencyInjection;
using CommunityToolkit.Mvvm.Input;
using FileConverter.Annotations; using FileConverter.Annotations;
using FileConverter.Services; using FileConverter.Services;
using FileConverter.Views; using FileConverter.Views;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using GalaSoft.MvvmLight.Ioc;
using GalaSoft.MvvmLight.Messaging;
using Microsoft.Win32;
/// <summary> /// <summary>
/// This class contains properties that the main View can data bind to. /// This class contains properties that the settings View can data bind to.
/// <para>
/// Use the <strong>mvvminpc</strong> snippet to add bindable properties to this ViewModel.
/// </para>
/// <para>
/// You can also use Blend to data bind with the tool's support.
/// </para>
/// <para>
/// See http://www.galasoft.ch/mvvm
/// </para>
/// </summary> /// </summary>
public class SettingsViewModel : ViewModelBase, IDataErrorInfo public class SettingsViewModel : ObservableRecipient, IDataErrorInfo
{ {
private InputExtensionCategory[] inputCategories; private InputExtensionCategory[] inputCategories;
private PresetFolderNode presetsRootFolder; private PresetFolderNode presetsRootFolder;
@ -59,6 +48,9 @@ namespace FileConverter.ViewModels
private ListCollectionView outputTypes; private ListCollectionView outputTypes;
private CultureInfo[] supportedCultures; private CultureInfo[] supportedCultures;
public event Action OnPresetCreated;
public event Action OnFolderCreated;
/// <summary> /// <summary>
/// Initializes a new instance of the SettingsViewModel class. /// Initializes a new instance of the SettingsViewModel class.
/// </summary> /// </summary>
@ -75,42 +67,33 @@ namespace FileConverter.ViewModels
this.saveCommand = new RelayCommand(this.SaveSettings, this.CanSaveSettings); this.saveCommand = new RelayCommand(this.SaveSettings, this.CanSaveSettings);
this.closeCommand = new RelayCommand<CancelEventArgs>(this.CloseSettings); this.closeCommand = new RelayCommand<CancelEventArgs>(this.CloseSettings);
if (this.IsInDesignMode) ISettingsService settingsService = Ioc.Default.GetRequiredService<ISettingsService>();
{ this.Settings = settingsService.Settings;
// Code runs in Blend --> create design time data.
this.Settings = new Settings();
this.Settings.ConversionPresets.Add(new ConversionPreset("Test", OutputType.Mp3));
}
else
{
ISettingsService settingsService = SimpleIoc.Default.GetInstance<ISettingsService>();
this.Settings = settingsService.Settings;
List<OutputTypeViewModel> outputTypeViewModels = new List<OutputTypeViewModel>(); List<OutputTypeViewModel> outputTypeViewModels = new List<OutputTypeViewModel>();
outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Ogg)); outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Ogg));
outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Mp3)); outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Mp3));
outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Aac)); outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Aac));
outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Flac)); outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Flac));
outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Wav)); outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Wav));
outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Mkv)); outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Mkv));
outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Mp4)); outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Mp4));
outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Ogv)); outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Ogv));
outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Webm)); outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Webm));
outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Avi)); outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Avi));
outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Png)); outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Png));
outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Jpg)); outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Jpg));
outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Webp)); outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Webp));
outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Ico)); outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Ico));
outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Gif)); outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Gif));
outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Pdf)); outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Pdf));
this.outputTypes = new ListCollectionView(outputTypeViewModels); this.outputTypes = new ListCollectionView(outputTypeViewModels);
this.outputTypes.GroupDescriptions.Add(new PropertyGroupDescription("Category")); this.outputTypes.GroupDescriptions.Add(new PropertyGroupDescription("Category"));
this.SupportedCultures = Helpers.GetSupportedCultures().ToArray(); this.SupportedCultures = Helpers.GetSupportedCultures().ToArray();
this.InitializeCompatibleInputExtensions(); this.InitializeCompatibleInputExtensions();
this.InitializePresetFolders(); this.InitializePresetFolders();
}
} }
public IEnumerable<InputExtensionCategory> InputCategories public IEnumerable<InputExtensionCategory> InputCategories
@ -147,7 +130,7 @@ namespace FileConverter.ViewModels
set set
{ {
this.presetsRootFolder = value; this.presetsRootFolder = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }
@ -181,7 +164,7 @@ namespace FileConverter.ViewModels
this.SelectedFolder = null; this.SelectedFolder = null;
} }
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }
@ -193,11 +176,11 @@ namespace FileConverter.ViewModels
{ {
this.selectedFolder = value; this.selectedFolder = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
this.RaisePropertyChanged(nameof(this.SelectedItem)); this.OnPropertyChanged(nameof(this.SelectedItem));
this.removePresetCommand?.RaiseCanExecuteChanged(); this.removePresetCommand?.NotifyCanExecuteChanged();
this.exportPresetCommand?.RaiseCanExecuteChanged(); this.exportPresetCommand?.NotifyCanExecuteChanged();
this.duplicatePresetCommand?.RaiseCanExecuteChanged(); this.duplicatePresetCommand?.NotifyCanExecuteChanged();
} }
} }
@ -219,12 +202,12 @@ namespace FileConverter.ViewModels
this.selectedPreset.Preset.PropertyChanged += this.SelectedPresetPropertyChanged; this.selectedPreset.Preset.PropertyChanged += this.SelectedPresetPropertyChanged;
} }
this.RaisePropertyChanged(); this.OnPropertyChanged();
this.RaisePropertyChanged(nameof(this.SelectedItem)); this.OnPropertyChanged(nameof(this.SelectedItem));
this.RaisePropertyChanged(nameof(this.InputCategories)); this.OnPropertyChanged(nameof(this.InputCategories));
this.removePresetCommand?.RaiseCanExecuteChanged(); this.removePresetCommand?.NotifyCanExecuteChanged();
this.exportPresetCommand?.RaiseCanExecuteChanged(); this.exportPresetCommand?.NotifyCanExecuteChanged();
this.duplicatePresetCommand?.RaiseCanExecuteChanged(); this.duplicatePresetCommand?.NotifyCanExecuteChanged();
} }
} }
@ -235,7 +218,7 @@ namespace FileConverter.ViewModels
set set
{ {
this.settings = value; this.settings = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }
@ -245,7 +228,7 @@ namespace FileConverter.ViewModels
set set
{ {
this.supportedCultures = value; this.supportedCultures = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }
@ -255,7 +238,7 @@ namespace FileConverter.ViewModels
set set
{ {
this.outputTypes = value; this.outputTypes = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }
@ -270,7 +253,7 @@ namespace FileConverter.ViewModels
{ {
this.displaySeeChangeLogLink = value; this.displaySeeChangeLogLink = value;
this.RaisePropertyChanged(); this.OnPropertyChanged();
} }
} }
@ -375,20 +358,20 @@ namespace FileConverter.ViewModels
{ {
if (eventArgs.PropertyName == "OutputType") if (eventArgs.PropertyName == "OutputType")
{ {
this.RaisePropertyChanged(nameof(this.InputCategories)); this.OnPropertyChanged(nameof(this.InputCategories));
} }
this.saveCommand.RaiseCanExecuteChanged(); this.saveCommand.NotifyCanExecuteChanged();
} }
private void NodePropertyChanged(object sender, PropertyChangedEventArgs eventArgs) private void NodePropertyChanged(object sender, PropertyChangedEventArgs eventArgs)
{ {
this.saveCommand.RaiseCanExecuteChanged(); this.saveCommand.NotifyCanExecuteChanged();
} }
private void DownloadChangeLogAction() private void DownloadChangeLogAction()
{ {
IUpgradeService upgradeService = SimpleIoc.Default.GetInstance<IUpgradeService>(); IUpgradeService upgradeService = Ioc.Default.GetRequiredService<IUpgradeService>();
upgradeService.DownloadChangeLog(); upgradeService.DownloadChangeLog();
this.DisplaySeeChangeLogLink = false; this.DisplaySeeChangeLogLink = false;
} }
@ -411,7 +394,7 @@ namespace FileConverter.ViewModels
} }
this.inputCategories = categories.ToArray(); this.inputCategories = categories.ToArray();
this.RaisePropertyChanged(nameof(this.InputCategories)); this.OnPropertyChanged(nameof(this.InputCategories));
} }
private void InitializePresetFolders() private void InitializePresetFolders()
@ -434,7 +417,7 @@ namespace FileConverter.ViewModels
this.CreatePresetNode(preset, parent); this.CreatePresetNode(preset, parent);
} }
this.RaisePropertyChanged(nameof(this.PresetsRootFolder)); this.OnPropertyChanged(nameof(this.PresetsRootFolder));
} }
private void ComputePresetsParentFoldersNamesAndFillSettings(AbstractTreeNode node, List<string> folderNamesCache) private void ComputePresetsParentFoldersNamesAndFillSettings(AbstractTreeNode node, List<string> folderNamesCache)
@ -465,10 +448,10 @@ namespace FileConverter.ViewModels
private void CloseSettings(CancelEventArgs args) private void CloseSettings(CancelEventArgs args)
{ {
ISettingsService settingsService = SimpleIoc.Default.GetInstance<ISettingsService>(); ISettingsService settingsService = Ioc.Default.GetRequiredService<ISettingsService>();
settingsService.RevertSettings(); settingsService.RevertSettings();
INavigationService navigationService = SimpleIoc.Default.GetInstance<INavigationService>(); INavigationService navigationService = Ioc.Default.GetRequiredService<INavigationService>();
navigationService.Close(Pages.Settings, args != null); navigationService.Close(Pages.Settings, args != null);
} }
@ -484,10 +467,10 @@ namespace FileConverter.ViewModels
this.ComputePresetsParentFoldersNamesAndFillSettings(this.presetsRootFolder, new List<string>()); this.ComputePresetsParentFoldersNamesAndFillSettings(this.presetsRootFolder, new List<string>());
// Save changes. // Save changes.
ISettingsService settingsService = SimpleIoc.Default.GetInstance<ISettingsService>(); ISettingsService settingsService = Ioc.Default.GetRequiredService<ISettingsService>();
settingsService.SaveSettings(); settingsService.SaveSettings();
INavigationService navigationService = SimpleIoc.Default.GetInstance<INavigationService>(); INavigationService navigationService = Ioc.Default.GetRequiredService<INavigationService>();
navigationService.Close(Pages.Settings, false); navigationService.Close(Pages.Settings, false);
} }
@ -530,9 +513,9 @@ namespace FileConverter.ViewModels
this.SelectedItem = newFolder; this.SelectedItem = newFolder;
this.saveCommand.RaiseCanExecuteChanged(); this.saveCommand.NotifyCanExecuteChanged();
Messenger.Default.Send<string>("FolderName", "DoFocus"); this.OnFolderCreated();
} }
private bool CanDuplicateSelectedPreset() private bool CanDuplicateSelectedPreset()
@ -590,10 +573,10 @@ namespace FileConverter.ViewModels
this.SelectedItem = node; this.SelectedItem = node;
Messenger.Default.Send<string>("PresetName", "DoFocus"); this.OnPresetCreated.Invoke();
this.removePresetCommand.RaiseCanExecuteChanged(); this.removePresetCommand.NotifyCanExecuteChanged();
this.saveCommand.RaiseCanExecuteChanged(); this.saveCommand.NotifyCanExecuteChanged();
} }
private void ImportPreset() private void ImportPreset()
@ -699,8 +682,8 @@ namespace FileConverter.ViewModels
this.SelectedItem = null; this.SelectedItem = null;
this.removePresetCommand.RaiseCanExecuteChanged(); this.removePresetCommand.NotifyCanExecuteChanged();
this.saveCommand.RaiseCanExecuteChanged(); this.saveCommand.NotifyCanExecuteChanged();
} }
private bool CanRemoveSelectedPreset() private bool CanRemoveSelectedPreset()
@ -708,9 +691,9 @@ namespace FileConverter.ViewModels
return this.SelectedItem != null; return this.SelectedItem != null;
} }
public override void Cleanup() protected override void OnDeactivated()
{ {
base.Cleanup(); base.OnDeactivated();
this.UnbindNode(this.presetsRootFolder); this.UnbindNode(this.presetsRootFolder);
} }

View File

@ -5,25 +5,16 @@ namespace FileConverter.ViewModels
using System.ComponentModel; using System.ComponentModel;
using System.Windows.Input; using System.Windows.Input;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.DependencyInjection;
using CommunityToolkit.Mvvm.Input;
using FileConverter.Services; using FileConverter.Services;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using GalaSoft.MvvmLight.Ioc;
/// <summary> /// <summary>
/// This class contains properties that the main View can data bind to. /// This class contains properties that the upgrade View can data bind to.
/// <para>
/// Use the <strong>mvvminpc</strong> snippet to add bindable properties to this ViewModel.
/// </para>
/// <para>
/// You can also use Blend to data bind with the tool's support.
/// </para>
/// <para>
/// See http://www.galasoft.ch/mvvm
/// </para>
/// </summary> /// </summary>
public class UpgradeViewModel : ViewModelBase public class UpgradeViewModel : ObservableRecipient
{ {
private readonly IUpgradeService upgradeService; private readonly IUpgradeService upgradeService;
@ -36,7 +27,7 @@ namespace FileConverter.ViewModels
/// </summary> /// </summary>
public UpgradeViewModel() public UpgradeViewModel()
{ {
this.upgradeService = SimpleIoc.Default.GetInstance<IUpgradeService>(); this.upgradeService = Ioc.Default.GetRequiredService<IUpgradeService>();
this.upgradeService.DownloadChangeLog(); this.upgradeService.DownloadChangeLog();
} }
@ -83,19 +74,19 @@ namespace FileConverter.ViewModels
{ {
this.upgradeService.StartUpgrade(); this.upgradeService.StartUpgrade();
INavigationService navigationService = SimpleIoc.Default.GetInstance<INavigationService>(); INavigationService navigationService = Ioc.Default.GetRequiredService<INavigationService>();
navigationService.Close(Pages.Upgrade, false); navigationService.Close(Pages.Upgrade, false);
} }
private void ExecuteLaunchInstallerCommand() private void ExecuteLaunchInstallerCommand()
{ {
INavigationService navigationService = SimpleIoc.Default.GetInstance<INavigationService>(); INavigationService navigationService = Ioc.Default.GetRequiredService<INavigationService>();
navigationService.Close(Pages.Upgrade, false); navigationService.Close(Pages.Upgrade, false);
} }
private void Close(CancelEventArgs args) private void Close(CancelEventArgs args)
{ {
INavigationService navigationService = SimpleIoc.Default.GetInstance<INavigationService>(); INavigationService navigationService = Ioc.Default.GetRequiredService<INavigationService>();
navigationService.Close(Pages.Upgrade, args != null); navigationService.Close(Pages.Upgrade, args != null);
} }
} }

View File

@ -9,21 +9,12 @@
In the View: In the View:
DataContext="{Binding Source={StaticResource Locator}, Path=ViewModelName}" DataContext="{Binding Source={StaticResource Locator}, Path=ViewModelName}"
You can also use Blend to do all this with the tool's support.
See http://www.galasoft.ch/mvvm
*/ */
namespace FileConverter.ViewModels namespace FileConverter.ViewModels
{ {
using System; using CommunityToolkit.Mvvm.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using CommonServiceLocator;
using FileConverter.Views;
using GalaSoft.MvvmLight.Ioc;
using GalaSoft.MvvmLight.Views;
/// <summary> /// <summary>
/// This class contains static references to all the view models in the /// This class contains static references to all the view models in the
@ -36,34 +27,26 @@ namespace FileConverter.ViewModels
/// </summary> /// </summary>
public ViewModelLocator() public ViewModelLocator()
{ {
ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);
////if (ViewModelBase.IsInDesignModeStatic)
////{
//// // Create design time view services and models
//// SimpleIoc.Default.Register<IDataService, DesignDataService>();
////}
////else
////{
//// // Create run time view services and models
//// SimpleIoc.Default.Register<IDataService, DataService>();
////}
SimpleIoc.Default.Register<HelpViewModel>();
SimpleIoc.Default.Register<MainViewModel>();
SimpleIoc.Default.Register<UpgradeViewModel>();
SimpleIoc.Default.Register<SettingsViewModel>();
SimpleIoc.Default.Register<DiagnosticsViewModel>();
} }
public HelpViewModel Help => ServiceLocator.Current.GetInstance<HelpViewModel>(); public HelpViewModel Help => Ioc.Default.GetRequiredService<HelpViewModel>();
public MainViewModel Main => ServiceLocator.Current.GetInstance<MainViewModel>(); public MainViewModel Main => Ioc.Default.GetRequiredService<MainViewModel>();
public UpgradeViewModel Upgrade => ServiceLocator.Current.GetInstance<UpgradeViewModel>(); public UpgradeViewModel Upgrade => Ioc.Default.GetRequiredService<UpgradeViewModel>();
public SettingsViewModel Settings => ServiceLocator.Current.GetInstance<SettingsViewModel>(); public SettingsViewModel Settings => Ioc.Default.GetRequiredService<SettingsViewModel>();
public DiagnosticsViewModel Diagnostics => ServiceLocator.Current.GetInstance<DiagnosticsViewModel>(); public DiagnosticsViewModel Diagnostics => Ioc.Default.GetRequiredService<DiagnosticsViewModel>();
internal void RegisterViewModels(ServiceCollection services)
{
services
.AddSingleton<HelpViewModel>()
.AddSingleton<MainViewModel>()
.AddSingleton<UpgradeViewModel>()
.AddSingleton<SettingsViewModel>()
.AddSingleton<DiagnosticsViewModel>();
}
} }
} }

View File

@ -3,7 +3,7 @@
using System.Collections.Specialized; using System.Collections.Specialized;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Interactivity; using Microsoft.Xaml.Behaviors;
namespace FileConverter.Views namespace FileConverter.Views
{ {

View File

@ -6,16 +6,15 @@
xmlns:diagnostics="clr-namespace:FileConverter.Diagnostics" xmlns:diagnostics="clr-namespace:FileConverter.Diagnostics"
xmlns:project="clr-namespace:FileConverter.Properties" xmlns:project="clr-namespace:FileConverter.Properties"
xmlns:local="clr-namespace:FileConverter" xmlns:local="clr-namespace:FileConverter"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
xmlns:command="http://www.galasoft.ch/mvvmlight"
mc:Ignorable="d" mc:Ignorable="d"
Height="600" Width="800" Icon="/FileConverter;component/Resources/ApplicationIcon.ico" Height="600" Width="800" Icon="/FileConverter;component/Resources/ApplicationIcon.ico"
DataContext="{Binding Diagnostics, Source={StaticResource Locator}}"> DataContext="{Binding Diagnostics, Source={StaticResource Locator}}">
<i:Interaction.Triggers> <behaviors:Interaction.Triggers>
<i:EventTrigger EventName="Closing"> <behaviors:EventTrigger EventName="Closing">
<command:EventToCommand Command="{Binding CloseCommand}" PassEventArgsToCommand="True" /> <behaviors:InvokeCommandAction Command="{Binding CloseCommand}" PassEventArgsToCommand="True" />
</i:EventTrigger> </behaviors:EventTrigger>
</i:Interaction.Triggers> </behaviors:Interaction.Triggers>
<Window.Title> <Window.Title>
<Binding Converter="{StaticResource ApplicationVersionToApplicationName}" Mode="OneWay" Path="(local:Application.ApplicationVersion)"/> <Binding Converter="{StaticResource ApplicationVersionToApplicationName}" Mode="OneWay" Path="(local:Application.ApplicationVersion)"/>
</Window.Title> </Window.Title>

View File

@ -6,16 +6,15 @@
xmlns:fileConverter="clr-namespace:FileConverter" xmlns:fileConverter="clr-namespace:FileConverter"
xmlns:project="clr-namespace:FileConverter.Properties" xmlns:project="clr-namespace:FileConverter.Properties"
xmlns:gif="http://wpfanimatedgif.codeplex.com" xmlns:gif="http://wpfanimatedgif.codeplex.com"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
xmlns:command="http://www.galasoft.ch/mvvmlight"
mc:Ignorable="d" Icon="/FileConverter;component/Resources/ApplicationIcon.ico" WindowStartupLocation="CenterScreen" WindowStyle="ToolWindow" ResizeMode="NoResize" mc:Ignorable="d" Icon="/FileConverter;component/Resources/ApplicationIcon.ico" WindowStartupLocation="CenterScreen" WindowStyle="ToolWindow" ResizeMode="NoResize"
Width="640" Height="545" Width="640" Height="545"
DataContext="{Binding Help, Source={StaticResource Locator}}"> DataContext="{Binding Help, Source={StaticResource Locator}}">
<i:Interaction.Triggers> <behaviors:Interaction.Triggers>
<i:EventTrigger EventName="Closing"> <behaviors:EventTrigger EventName="Closing">
<command:EventToCommand Command="{Binding CloseCommand}" PassEventArgsToCommand="True" /> <behaviors:InvokeCommandAction Command="{Binding CloseCommand}" PassEventArgsToCommand="True" />
</i:EventTrigger> </behaviors:EventTrigger>
</i:Interaction.Triggers> </behaviors:Interaction.Triggers>
<Window.Resources> <Window.Resources>
</Window.Resources> </Window.Resources>
<Window.Title> <Window.Title>

View File

@ -6,16 +6,15 @@
xmlns:valueConverters="clr-namespace:FileConverter.ValueConverters" xmlns:valueConverters="clr-namespace:FileConverter.ValueConverters"
xmlns:project="clr-namespace:FileConverter.Properties" xmlns:project="clr-namespace:FileConverter.Properties"
xmlns:controls="clr-namespace:FileConverter.Controls" xmlns:controls="clr-namespace:FileConverter.Controls"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
xmlns:command="http://www.galasoft.ch/mvvmlight"
mc:Ignorable="d" x:Class="FileConverter.Views.MainWindow" mc:Ignorable="d" x:Class="FileConverter.Views.MainWindow"
Height="500" Width="950" MinHeight="480" MinWidth="640" WindowStartupLocation="CenterScreen" Icon="/FileConverter;component/Resources/ApplicationIcon.ico" Height="500" Width="950" MinHeight="480" MinWidth="640" WindowStartupLocation="CenterScreen" Icon="/FileConverter;component/Resources/ApplicationIcon.ico"
DataContext="{Binding Main, Source={StaticResource Locator}}"> DataContext="{Binding Main, Source={StaticResource Locator}}">
<i:Interaction.Triggers> <behaviors:Interaction.Triggers>
<i:EventTrigger EventName="Closing"> <behaviors:EventTrigger EventName="Closing">
<command:EventToCommand Command="{Binding CloseCommand}" PassEventArgsToCommand="True" /> <behaviors:InvokeCommandAction Command="{Binding CloseCommand}" PassEventArgsToCommand="True" />
</i:EventTrigger> </behaviors:EventTrigger>
</i:Interaction.Triggers> </behaviors:Interaction.Triggers>
<Window.Resources> <Window.Resources>
<valueConverters:ConversionJobsToProgressState x:Key="ConversionJobsToProgressState" /> <valueConverters:ConversionJobsToProgressState x:Key="ConversionJobsToProgressState" />
<valueConverters:ConversionJobsToProgressValue x:Key="ConversionJobsToProgressValue" /> <valueConverters:ConversionJobsToProgressValue x:Key="ConversionJobsToProgressValue" />

View File

@ -6,8 +6,7 @@
xmlns:project="clr-namespace:FileConverter.Properties" xmlns:project="clr-namespace:FileConverter.Properties"
xmlns:views="clr-namespace:FileConverter.Views" xmlns:views="clr-namespace:FileConverter.Views"
xmlns:viewModels="clr-namespace:FileConverter.ViewModels" xmlns:viewModels="clr-namespace:FileConverter.ViewModels"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
xmlns:command="http://www.galasoft.ch/mvvmlight"
xmlns:generic="clr-namespace:FileConverter.ValueConverters.Generic" xmlns:generic="clr-namespace:FileConverter.ValueConverters.Generic"
xmlns:controls="clr-namespace:FileConverter.Controls" xmlns:controls="clr-namespace:FileConverter.Controls"
x:Class="FileConverter.Views.SettingsWindow" x:Class="FileConverter.Views.SettingsWindow"
@ -17,11 +16,11 @@
mc:Ignorable="d" mc:Ignorable="d"
DataContext="{Binding Settings, Source={StaticResource Locator}}" DataContext="{Binding Settings, Source={StaticResource Locator}}"
d:DataContext="{d:DesignData /SampleData/SettingsSampleData.xaml}"> d:DataContext="{d:DesignData /SampleData/SettingsSampleData.xaml}">
<i:Interaction.Triggers> <behaviors:Interaction.Triggers>
<i:EventTrigger EventName="Closing"> <behaviors:EventTrigger EventName="Closing">
<command:EventToCommand Command="{Binding CloseCommand}" PassEventArgsToCommand="True" /> <behaviors:InvokeCommandAction Command="{Binding CloseCommand}" PassEventArgsToCommand="True" />
</i:EventTrigger> </behaviors:EventTrigger>
</i:Interaction.Triggers> </behaviors:Interaction.Triggers>
<Window.Resources> <Window.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
@ -292,12 +291,12 @@
<EventSetter Event="MouseMove" Handler="TreeView_MouseMove"/> <EventSetter Event="MouseMove" Handler="TreeView_MouseMove"/>
</Style> </Style>
</TreeView.ItemContainerStyle> </TreeView.ItemContainerStyle>
<i:Interaction.Behaviors> <behaviors:Interaction.Behaviors>
<views:TreeViewSelectionBehavior <views:TreeViewSelectionBehavior
SelectedItem="{Binding SelectedItem, Mode=TwoWay}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
HierarchyPredicate="{Binding PresetsHierarchyPredicate}" HierarchyPredicate="{Binding PresetsHierarchyPredicate}"
ExpandSelected="False"/> ExpandSelected="False"/>
</i:Interaction.Behaviors> </behaviors:Interaction.Behaviors>
<TreeView.ContextMenu> <TreeView.ContextMenu>
<ContextMenu> <ContextMenu>
<MenuItem Header="{x:Static project:Resources.CreateANewFolder}" Command="{Binding CreateFolderCommand}"> <MenuItem Header="{x:Static project:Resources.CreateANewFolder}" Command="{Binding CreateFolderCommand}">

View File

@ -2,8 +2,7 @@
namespace FileConverter.Views namespace FileConverter.Views
{ {
using System; using System.ComponentModel;
using System.Linq;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Input; using System.Windows.Input;
@ -12,8 +11,6 @@ namespace FileConverter.Views
using FileConverter.Diagnostics; using FileConverter.Diagnostics;
using FileConverter.ViewModels; using FileConverter.ViewModels;
using GalaSoft.MvvmLight.Messaging;
/// <summary> /// <summary>
/// Interaction logic for Settings. /// Interaction logic for Settings.
/// </summary> /// </summary>
@ -35,14 +32,30 @@ namespace FileConverter.Views
{ {
this.InitializeComponent(); this.InitializeComponent();
Messenger.Default.Register<string>(this, "DoFocus", this.DoFocus); SettingsViewModel settingsViewModel = this.DataContext as SettingsViewModel;
settingsViewModel.OnPresetCreated += this.SettingsWindow_OnPresetCreated;
settingsViewModel.OnFolderCreated += this.SettingsWindow_OnFolderCreated;
(this.DataContext as SettingsViewModel).PropertyChanged += this.SettingsWindow_PropertyChanged; settingsViewModel.PropertyChanged += this.SettingsWindow_PropertyChanged;
this.PresetTreeView.MouseDown += this.TreeView_MouseDown; this.PresetTreeView.MouseDown += this.TreeView_MouseDown;
this.PresetTreeView.MouseUp += this.TreeView_MouseUp; this.PresetTreeView.MouseUp += this.TreeView_MouseUp;
} }
private void SettingsWindow_OnPresetCreated()
{
this.focusMessage = "PresetName";
this.selectedPresetNameTextBox?.Focus();
this.selectedPresetNameTextBox?.SelectAll();
}
private void SettingsWindow_OnFolderCreated()
{
this.focusMessage = "FolderName";
this.selectedFolderNameTextBox?.Focus();
this.selectedFolderNameTextBox?.SelectAll();
}
private void SettingsWindow_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs args) private void SettingsWindow_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs args)
{ {
if (args.PropertyName == "SelectedItem") if (args.PropertyName == "SelectedItem")
@ -52,23 +65,6 @@ namespace FileConverter.Views
} }
} }
public void DoFocus(string message)
{
this.focusMessage = message;
switch (message)
{
case "PresetName":
this.selectedPresetNameTextBox?.Focus();
this.selectedPresetNameTextBox?.SelectAll();
break;
case "FolderName":
this.selectedFolderNameTextBox?.Focus();
this.selectedFolderNameTextBox?.SelectAll();
break;
}
}
private void TreeView_MouseDown(object sender, MouseButtonEventArgs args) private void TreeView_MouseDown(object sender, MouseButtonEventArgs args)
{ {
FrameworkElement element = args.OriginalSource as FrameworkElement; FrameworkElement element = args.OriginalSource as FrameworkElement;
@ -345,7 +341,7 @@ namespace FileConverter.Views
this.selectedPresetNameTextBox = (TextBox)sender; this.selectedPresetNameTextBox = (TextBox)sender;
if (this.focusMessage == "PresetName") if (this.focusMessage == "PresetName")
{ {
this.DoFocus(this.focusMessage); this.selectedPresetNameTextBox.Focus();
this.focusMessage = null; this.focusMessage = null;
} }
} }
@ -355,7 +351,7 @@ namespace FileConverter.Views
this.selectedFolderNameTextBox = (TextBox)sender; this.selectedFolderNameTextBox = (TextBox)sender;
if (this.focusMessage == "FolderName") if (this.focusMessage == "FolderName")
{ {
this.DoFocus(this.focusMessage); this.selectedFolderNameTextBox.Focus();
this.focusMessage = null; this.focusMessage = null;
} }
} }

View File

@ -4,19 +4,18 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:project="clr-namespace:FileConverter.Properties" xmlns:project="clr-namespace:FileConverter.Properties"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
xmlns:command="http://www.galasoft.ch/mvvmlight"
mc:Ignorable="d" mc:Ignorable="d"
Title="{x:Static project:Resources.UpgradeWindowTitle}" Title="{x:Static project:Resources.UpgradeWindowTitle}"
WindowStartupLocation="CenterScreen" Icon="/FileConverter;component/Resources/ApplicationIcon.ico" WindowStartupLocation="CenterScreen" Icon="/FileConverter;component/Resources/ApplicationIcon.ico"
MinHeight="300" MinWidth="450" MinHeight="300" MinWidth="450"
Height="450" Width="450" WindowStyle="ToolWindow" Height="450" Width="450" WindowStyle="ToolWindow"
DataContext="{Binding Upgrade, Source={StaticResource Locator}}"> DataContext="{Binding Upgrade, Source={StaticResource Locator}}">
<i:Interaction.Triggers> <behaviors:Interaction.Triggers>
<i:EventTrigger EventName="Closing"> <behaviors:EventTrigger EventName="Closing">
<command:EventToCommand Command="{Binding CloseCommand}" PassEventArgsToCommand="True" /> <behaviors:InvokeCommandAction Command="{Binding CloseCommand}" PassEventArgsToCommand="True" />
</i:EventTrigger> </behaviors:EventTrigger>
</i:Interaction.Triggers> </behaviors:Interaction.Triggers>
<Window.Resources> <Window.Resources>
</Window.Resources> </Window.Resources>
<Grid> <Grid>

View File

@ -2,12 +2,6 @@
namespace FileConverter namespace FileConverter
{ {
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml;
using System.Xml.Serialization;
public class XmlHelpers public class XmlHelpers
{ {
public static void LoadFromFile<T>(string root, string path, out T deserializedObject) public static void LoadFromFile<T>(string root, string path, out T deserializedObject)

View File

@ -1,14 +1,22 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="CommonServiceLocator" version="2.0.7" targetFramework="net48" /> <package id="CommunityToolkit.Mvvm" version="8.2.2" targetFramework="net48" />
<package id="Magick.NET.Core" version="13.5.0" targetFramework="net48" /> <package id="Magick.NET.Core" version="13.5.0" targetFramework="net48" />
<package id="Magick.NET-Q16-AnyCPU" version="13.5.0" targetFramework="net48" /> <package id="Magick.NET-Q16-AnyCPU" version="13.5.0" targetFramework="net48" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="8.0.0" targetFramework="net48" />
<package id="Microsoft.Extensions.DependencyInjection" version="8.0.0" targetFramework="net48" />
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="8.0.0" targetFramework="net48" />
<package id="Microsoft.Office.Interop.Excel" version="15.0.4795.1000" targetFramework="net45" /> <package id="Microsoft.Office.Interop.Excel" version="15.0.4795.1000" targetFramework="net45" />
<package id="Microsoft.Office.Interop.PowerPoint" version="12.0.4518.1014" targetFramework="net45" /> <package id="Microsoft.Office.Interop.PowerPoint" version="12.0.4518.1014" targetFramework="net45" />
<package id="Microsoft.Office.Interop.Word" version="15.0.4797.1003" targetFramework="net45" /> <package id="Microsoft.Office.Interop.Word" version="15.0.4797.1003" targetFramework="net45" />
<package id="MvvmLight" version="5.4.1.1" targetFramework="net45" /> <package id="Microsoft.Xaml.Behaviors.Wpf" version="1.1.77" targetFramework="net48" />
<package id="MvvmLightLibs" version="5.4.1.1" targetFramework="net45" />
<package id="Office" version="12.0.0" targetFramework="net45" /> <package id="Office" version="12.0.0" targetFramework="net45" />
<package id="SharpShell" version="2.7.2" targetFramework="net462" /> <package id="SharpShell" version="2.7.2" targetFramework="net462" />
<package id="System.Buffers" version="4.5.1" targetFramework="net48" />
<package id="System.ComponentModel.Annotations" version="5.0.0" targetFramework="net48" />
<package id="System.Memory" version="4.5.5" targetFramework="net48" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net48" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net48" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net48" />
<package id="WpfAnimatedGif" version="2.0.2" targetFramework="net462" /> <package id="WpfAnimatedGif" version="2.0.2" targetFramework="net462" />
</packages> </packages>

View File

@ -84,22 +84,6 @@
</Component> </Component>
<!-- Third parties --> <!-- Third parties -->
<Component Guid="{FF99FD36-9C73-472D-AA18-9384DB7708A6}">
<File Id="CommonServiceLocator.dll" KeyPath="yes" Source="$(var.FileConverter.TargetDir)CommonServiceLocator.dll" Checksum="yes" />
</Component>
<Component Guid="{2D5509A2-A752-4E4D-A706-E90F041D0B7D}">
<File Id="GalaSoft.MvvmLight.dll" KeyPath="yes" Source="$(var.FileConverter.TargetDir)GalaSoft.MvvmLight.dll" Checksum="yes" />
</Component>
<Component Guid="{D4F2C1DD-800D-407D-B863-1FE6C3069D3C}">
<File Id="GalaSoft.MvvmLight.Extras.dll" KeyPath="yes" Source="$(var.FileConverter.TargetDir)GalaSoft.MvvmLight.Extras.dll" Checksum="yes" />
</Component>
<Component Guid="{48D1EE43-F7D7-4611-B3AC-B2652ED68261}">
<File Id="GalaSoft.MvvmLight.Platform.dll" KeyPath="yes" Source="$(var.FileConverter.TargetDir)GalaSoft.MvvmLight.Platform.dll" Checksum="yes" />
</Component>
<Component Guid="{08FB2B2B-7686-4698-B864-0AD39CF3128D}">
<File Id="System.Windows.Interactivity.dll" KeyPath="yes" Source="$(var.FileConverter.TargetDir)System.Windows.Interactivity.dll" Checksum="yes" />
</Component>
<Component Guid="{BEEAAC73-C479-4080-83B1-2B1448C7378C}"> <Component Guid="{BEEAAC73-C479-4080-83B1-2B1448C7378C}">
<File Id="___var.FileConverter.TargetDir_ffmpeg.exe" Source="$(var.FileConverter.TargetDir)ffmpeg.exe" KeyPath="yes" Checksum="yes" /> <File Id="___var.FileConverter.TargetDir_ffmpeg.exe" Source="$(var.FileConverter.TargetDir)ffmpeg.exe" KeyPath="yes" Checksum="yes" />
</Component> </Component>