A Swiss Army knife for developers.
C# blazorcross-platformcsharpdesktopdesktop-appdesktop-applicationdeveloper-toolsextensiblefluentfluent-designlinuxmacosmicasyntax-highlightingtypescriptwindowswindows-10windows-11winui
Image converter tool (#139)
Rafael López97f67c98bdb6
diff --git a/README.md b/README.mdindex bff5a52db..d7000e105 100644--- a/README.md+++ b/README.md@@ -49,6 +49,7 @@ Many tools are available.- Graphic- Color Blindness Simulator- PNG / JPEG Compressor+ - Image Converter... and more are coming!@@ -101,6 +102,7 @@ Here is the list of tool name you can use:- `jwt` - JWT Decoder- `colorblind` - Color Blindness Simulator- `imgcomp` - PNG/JPEG compressor+- `imageconverter` - Image Converter- `markdown` - Markdown Preview- `regex` - Regular Expression Tester- `baseconverter` - Number Base Converterdiff --git a/src/dev/impl/DevToys/DevToys.csproj b/src/dev/impl/DevToys/DevToys.csprojindex 3792a8f1f..c96af0d11 100644--- a/src/dev/impl/DevToys/DevToys.csproj+++ b/src/dev/impl/DevToys/DevToys.csproj@@ -28,6 +28,8 @@<Compile Include="Api\Tools\ParentAttribute.cs" /><Compile Include="Core\OOP\AppService.cs" /><Compile Include="Core\Threading\AsyncLazy.cs" />+ <Compile Include="Helpers\StorageFileHelper.cs" />+ <Compile Include="Helpers\ImageHelper.cs" /><Compile Include="Helpers\ColorBlindnessSimulatorHelper.cs" /><Compile Include="Helpers\NumberBaseHelper.cs" /><Compile Include="Messages\PinToolToStartMessage.cs" />@@ -57,6 +59,9 @@<Compile Include="ViewModels\Tools\Graphic\ColorBlindnessSimulator\ColorBlindnessSimulatorToolProvider.cs" /><Compile Include="ViewModels\Tools\Graphic\ColorBlindnessSimulator\ColorBlindnessSimulatorToolViewModel.cs" /><Compile Include="ViewModels\Tools\Graphic\GraphicGroupToolProvider.cs" />+ <Compile Include="ViewModels\Tools\Graphic\ImageConverter\ImageConversionWorkItem.cs" />+ <Compile Include="ViewModels\Tools\Graphic\ImageConverter\ImageConverterToolProvider.cs" />+ <Compile Include="ViewModels\Tools\Graphic\ImageConverter\ImageConverterToolViewModel.cs" /><Compile Include="ViewModels\Tools\GroupToolProviderBase.cs" /><Compile Include="ViewModels\Tools\GroupToolViewModel.cs" /><Compile Include="ViewModels\Tools\EncodersDecoders\HtmlEncoderDecoder\HtmlEncoderDecoderToolProvider.cs" />@@ -89,6 +94,9 @@<Compile Include="Views\Tools\EncodersDecoders\HtmlEncoderDecoder\HtmlEncoderDecoderToolPage.xaml.cs"><DependentUpon>HtmlEncoderDecoderToolPage.xaml</DependentUpon></Compile>+ <Compile Include="Views\Tools\Graphic\ImageConverter\ImageConverterToolPage.xaml.cs">+ <DependentUpon>ImageConverterToolPage.xaml</DependentUpon>+ </Compile><Compile Include="Views\Tools\Generators\LoremIpsumGenerator\LoremIpsumGeneratorToolPage.xaml.cs"><DependentUpon>LoremIpsumGeneratorToolPage.xaml</DependentUpon></Compile>@@ -537,6 +545,10 @@<SubType>Designer</SubType><Generator>MSBuild:Compile</Generator></Page>+ <Page Include="Views\Tools\Graphic\ImageConverter\ImageConverterToolPage.xaml">+ <Generator>MSBuild:Compile</Generator>+ <SubType>Designer</SubType>+ </Page><Page Include="Views\Tools\Converters\NumberBaseConverter\NumberBaseConverterToolPage.xaml"><Generator>MSBuild:Compile</Generator><SubType>Designer</SubType>diff --git a/src/dev/impl/DevToys/Helpers/ImageHelper.cs b/src/dev/impl/DevToys/Helpers/ImageHelper.csnew file mode 100644index 000000000..851c82d6b--- /dev/null+++ b/src/dev/impl/DevToys/Helpers/ImageHelper.cs@@ -0,0 +1,65 @@+#nullable enable++using System;+using System.Threading.Tasks;+using Windows.Foundation;+using Windows.Graphics.Imaging;+using Windows.Storage.Streams;++namespace DevToys.Helpers+{+ public static class ImageHelper+ {+ public static bool IsJpegFormat(string format) { return string.Equals(format, "JPEG", StringComparison.Ordinal) || string.Equals(format, "JPEGXR", StringComparison.Ordinal); }++ public static string GetExtension(string format)+ {+ return format switch+ {+ "PNG" => ".png",+ "JPEG" => ".jpg",+ "JPEGXR" => ".jxr",+ "BMP" => ".bmp",+ "TIFF" => ".tif",+ "HEIF" => ".heic",+ "GIF" => ".gif",+ _ => throw new NotSupportedException()+ };+ }++ public static async Task<BitmapEncoder> GetEncoderAsync(string format, IRandomAccessStream encoderAccessStream)+ {+ var encodingOptions = new BitmapPropertySet();++ if (IsJpegFormat(format))+ {+ var booleanBitmapTypedValue = new BitmapTypedValue(1, PropertyType.Single);+ encodingOptions.Add("ImageQuality", booleanBitmapTypedValue);+ }++ if (encodingOptions.Count > 0)+ {+ return await BitmapEncoder.CreateAsync(GetEncoderGuid(format), encoderAccessStream, encodingOptions);+ }+ else+ {+ return await BitmapEncoder.CreateAsync(GetEncoderGuid(format), encoderAccessStream);+ }+ }++ public static Guid GetEncoderGuid(string format)+ {+ return format switch+ {+ "PNG" => BitmapEncoder.PngEncoderId,+ "JPEG" => BitmapEncoder.JpegEncoderId,+ "JPEGXR" => BitmapEncoder.JpegXREncoderId,+ "BMP" => BitmapEncoder.BmpEncoderId,+ "TIFF" => BitmapEncoder.TiffEncoderId,+ "HEIF" => BitmapEncoder.HeifEncoderId,+ "GIF" => BitmapEncoder.GifEncoderId,+ _ => throw new NotSupportedException()+ };+ }+ }+}diff --git a/src/dev/impl/DevToys/Helpers/StorageFileHelper.cs b/src/dev/impl/DevToys/Helpers/StorageFileHelper.csnew file mode 100644index 000000000..7741b6508--- /dev/null+++ b/src/dev/impl/DevToys/Helpers/StorageFileHelper.cs@@ -0,0 +1,29 @@+#nullable enable++namespace DevToys.Helpers+{+ public static class StorageFileHelper+ {+ public static readonly string[] SizesStrings+ = {+ LanguageManager.Instance.Common.Bytes,+ LanguageManager.Instance.Common.Kilobytes,+ LanguageManager.Instance.Common.Megabytes,+ LanguageManager.Instance.Common.Gigabytes,+ LanguageManager.Instance.Common.Terabytes+ };++ public static string HumanizeFileSize(double fileSize, string fileSizeDisplay)+ {+ int order = 0;+ while (fileSize >= 1024 && order < SizesStrings.Length - 1)+ {+ order++;+ fileSize /= 1024;+ }++ string fileSizeString = string.Format(fileSizeDisplay, fileSize, SizesStrings[order]);+ return fileSizeString;+ }+ }+}diff --git a/src/dev/impl/DevToys/LanguageManager.cs b/src/dev/impl/DevToys/LanguageManager.csindex d07fe64de..1c73c1809 100644--- a/src/dev/impl/DevToys/LanguageManager.cs+++ b/src/dev/impl/DevToys/LanguageManager.cs@@ -32,6 +32,7 @@ namespace DevToysprivate readonly GZipEncoderDecoderStrings _gzipencoderdecoder = new GZipEncoderDecoderStrings();private readonly HashGeneratorStrings _hashgenerator = new HashGeneratorStrings();private readonly HtmlEncoderDecoderStrings _htmlencoderdecoder = new HtmlEncoderDecoderStrings();+ private readonly ImageConverterStrings _imageconverter = new ImageConverterStrings();private readonly JsonFormatterStrings _jsonformatter = new JsonFormatterStrings();private readonly JsonYamlStrings _jsonyaml = new JsonYamlStrings();private readonly JwtDecoderEncoderStrings _jwtdecoderencoder = new JwtDecoderEncoderStrings();@@ -98,6 +99,11 @@ namespace DevToys/// </summary>public HtmlEncoderDecoderStrings HtmlEncoderDecoder => _htmlencoderdecoder;+ /// <summary>+ /// Gets the <see cref="ImageConverterStrings"/>.+ /// </summary>+ public ImageConverterStrings ImageConverter => _imageconverter;+/// <summary>/// Gets the <see cref="JsonFormatterStrings"/>./// </summary>@@ -798,6 +804,151 @@ namespace DevToyspublic string SearchDisplayName => _resources.GetString("SearchDisplayName");}+ public class ImageConverterStrings : ObservableObject+ {+ private readonly ResourceLoader _resources = ResourceLoader.GetForViewIndependentUse("ImageConverter");++ /// <summary>+ /// Gets the resource AccessibleName.+ /// </summary>+ public string AccessibleName => _resources.GetString("AccessibleName");++ /// <summary>+ /// Gets the resource Cancel.+ /// </summary>+ public string Cancel => _resources.GetString("Cancel");++ /// <summary>+ /// Gets the resource Configuration.+ /// </summary>+ public string Configuration => _resources.GetString("Configuration");++ /// <summary>+ /// Gets the resource Delete.+ /// </summary>+ public string Delete => _resources.GetString("Delete");++ /// <summary>+ /// Gets the resource DeleteAll.+ /// </summary>+ public string DeleteAll => _resources.GetString("DeleteAll");++ /// <summary>+ /// Gets the resource DetailsTitle.+ /// </summary>+ public string DetailsTitle => _resources.GetString("DetailsTitle");++ /// <summary>+ /// Gets the resource MenuDisplayName.+ /// </summary>+ public string MenuDisplayName => _resources.GetString("MenuDisplayName");++ /// <summary>+ /// Gets the resource FileSizeDisplay.+ /// </summary>+ public string FileSizeDisplay => _resources.GetString("FileSizeDisplay");++ /// <summary>+ /// Gets the resource InvalidSelectedFiles.+ /// </summary>+ public string InvalidSelectedFiles => _resources.GetString("InvalidSelectedFiles");++ /// <summary>+ /// Gets the resource OK.+ /// </summary>+ public string OK => _resources.GetString("OK");++ /// <summary>+ /// Gets the resource SaveAll.+ /// </summary>+ public string SaveAll => _resources.GetString("SaveAll");++ /// <summary>+ /// Gets the resource SaveAs.+ /// </summary>+ public string SaveAs => _resources.GetString("SaveAs");++ /// <summary>+ /// Gets the resource SeeErrorMessage.+ /// </summary>+ public string SeeErrorMessage => _resources.GetString("SeeErrorMessage");++ /// <summary>+ /// Gets the resource SelectFilesInstruction1.+ /// </summary>+ public string SelectFilesInstruction1 => _resources.GetString("SelectFilesInstruction1");++ /// <summary>+ /// Gets the resource SelectFilesInstruction2.+ /// </summary>+ public string SelectFilesInstruction2 => _resources.GetString("SelectFilesInstruction2");++ /// <summary>+ /// Gets the resource SelectFilesInstruction3.+ /// </summary>+ public string SelectFilesInstruction3 => _resources.GetString("SelectFilesInstruction3");++ /// <summary>+ /// Gets the resource Description.+ /// </summary>+ public string Description => _resources.GetString("Description");++ /// <summary>+ /// Gets the resource SearchDisplayName.+ /// </summary>+ public string SearchDisplayName => _resources.GetString("SearchDisplayName");++ /// <summary>+ /// Gets the resource ConversionTitle.+ /// </summary>+ public string ConversionTitle => _resources.GetString("ConversionTitle");++ /// <summary>+ /// Gets the resource ConvertedFormatDescription.+ /// </summary>+ public string ConvertedFormatDescription => _resources.GetString("ConvertedFormatDescription");++ /// <summary>+ /// Gets the resource JPEG.+ /// </summary>+ public string JPEG => _resources.GetString("JPEG");++ /// <summary>+ /// Gets the resource PNG.+ /// </summary>+ public string PNG => _resources.GetString("PNG");++ /// <summary>+ /// Gets the resource BMP.+ /// </summary>+ public string BMP => _resources.GetString("BMP");++ /// <summary>+ /// Gets the resource GIF.+ /// </summary>+ public string GIF => _resources.GetString("GIF");++ /// <summary>+ /// Gets the resource HEIF.+ /// </summary>+ public string HEIF => _resources.GetString("HEIF");++ /// <summary>+ /// Gets the resource JPEGXR.+ /// </summary>+ public string JPEGXR => _resources.GetString("JPEGXR");++ /// <summary>+ /// Gets the resource TIFF.+ /// </summary>+ public string TIFF => _resources.GetString("TIFF");++ /// <summary>+ /// Gets the resource ErrorMessage.+ /// </summary>+ public string ErrorMessage => _resources.GetString("ErrorMessage");+ }+public class JsonFormatterStrings : ObservableObject{private readonly ResourceLoader _resources = ResourceLoader.GetForViewIndependentUse("JsonFormatter");diff --git a/src/dev/impl/DevToys/Strings/cs-CZ/ImageConverter.resw b/src/dev/impl/DevToys/Strings/cs-CZ/ImageConverter.reswnew file mode 100644index 000000000..ca2eeb44f--- /dev/null+++ b/src/dev/impl/DevToys/Strings/cs-CZ/ImageConverter.resw@@ -0,0 +1,205 @@+<?xml version="1.0" encoding="utf-8"?>+<root>+ <!--+ Microsoft ResX Schema++ Version 2.0++ The primary goals of this format is to allow a simple XML format+ that is mostly human readable. The generation and parsing of the+ various data types are done through the TypeConverter classes+ associated with the data types.++ Example:++ ... ado.net/XML headers & schema ...+ <resheader name="resmimetype">text/microsoft-resx</resheader>+ <resheader name="version">2.0</resheader>+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">+ <value>[base64 mime encoded serialized .NET Framework object]</value>+ </data>+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>+ <comment>This is a comment</comment>+ </data>++ There are any number of "resheader" rows that contain simple+ name/value pairs.++ Each data row contains a name, and value. The row also contains a+ type or mimetype. Type corresponds to a .NET class that support+ text/value conversion through the TypeConverter architecture.+ Classes that don't support this are serialized and stored with the+ mimetype set.++ The mimetype is used for serialized objects, and tells the+ ResXResourceReader how to depersist the object. This is currently not+ extensible. For a given mimetype the value must be set accordingly:++ Note - application/x-microsoft.net.object.binary.base64 is the format+ that the ResXResourceWriter will generate, however the reader can+ read any of the formats listed below.++ mimetype: application/x-microsoft.net.object.binary.base64+ value : The object must be serialized with+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter+ : and then encoded with base64 encoding.++ mimetype: application/x-microsoft.net.object.soap.base64+ value : The object must be serialized with+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter+ : and then encoded with base64 encoding.++ mimetype: application/x-microsoft.net.object.bytearray.base64+ value : The object must be serialized into a byte array+ : using a System.ComponentModel.TypeConverter+ : and then encoded with base64 encoding.+ -->+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />+ <xsd:element name="root" msdata:IsDataSet="true">+ <xsd:complexType>+ <xsd:choice maxOccurs="unbounded">+ <xsd:element name="metadata">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" />+ </xsd:sequence>+ <xsd:attribute name="name" use="required" type="xsd:string" />+ <xsd:attribute name="type" type="xsd:string" />+ <xsd:attribute name="mimetype" type="xsd:string" />+ <xsd:attribute ref="xml:space" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="assembly">+ <xsd:complexType>+ <xsd:attribute name="alias" type="xsd:string" />+ <xsd:attribute name="name" type="xsd:string" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="data">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />+ </xsd:sequence>+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />+ <xsd:attribute ref="xml:space" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="resheader">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />+ </xsd:sequence>+ <xsd:attribute name="name" type="xsd:string" use="required" />+ </xsd:complexType>+ </xsd:element>+ </xsd:choice>+ </xsd:complexType>+ </xsd:element>+ </xsd:schema>+ <resheader name="resmimetype">+ <value>text/microsoft-resx</value>+ </resheader>+ <resheader name="version">+ <value>2.0</value>+ </resheader>+ <resheader name="reader">+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>+ </resheader>+ <resheader name="writer">+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>+ </resheader>+ <data name="AccessibleName" xml:space="preserve">+ <value>Image Converter tool</value>+ </data>+ <data name="Cancel" xml:space="preserve">+ <value>Cancel</value>+ </data>+ <data name="Configuration" xml:space="preserve">+ <value>Configuration</value>+ </data>+ <data name="Delete" xml:space="preserve">+ <value>Delete</value>+ </data>+ <data name="DeleteAll" xml:space="preserve">+ <value>Delete all</value>+ </data>+ <data name="DetailsTitle" xml:space="preserve">+ <value>Details</value>+ </data>+ <data name="MenuDisplayName" xml:space="preserve">+ <value>Image Converter</value>+ </data>+ <data name="FileSizeDisplay" xml:space="preserve">+ <value>{0:0.##} {1}</value>+ <comment>{0} is a decimal number representing a file size. {1} is a unit, like Bytes, KB, MB, GB, TB</comment>+ </data>+ <data name="InvalidSelectedFiles" xml:space="preserve">+ <value>Only .png, .jpg and .jpeg files can be used.</value>+ </data>+ <data name="OK" xml:space="preserve">+ <value>OK</value>+ </data>+ <data name="SaveAll" xml:space="preserve">+ <value>Save all</value>+ </data>+ <data name="SaveAs" xml:space="preserve">+ <value>Save as</value>+ </data>+ <data name="SeeErrorMessage" xml:space="preserve">+ <value>See details</value>+ </data>+ <data name="SelectFilesInstruction1" xml:space="preserve">+ <value>Drag & drop image files here</value>+ </data>+ <data name="SelectFilesInstruction2" xml:space="preserve">+ <value>or</value>+ </data>+ <data name="SelectFilesInstruction3" xml:space="preserve">+ <value>Browse files</value>+ </data>+ <data name="Description" xml:space="preserve">+ <value>Lossless image converter</value>+ </data>+ <data name="SearchDisplayName" xml:space="preserve">+ <value>Image Converter</value>+ </data>+ <data name="ConversionTitle" xml:space="preserve">+ <value>Conversion</value>+ </data>+ <data name="ConvertedFormatDescription" xml:space="preserve">+ <value>Select the converted file format</value>+ </data>+ <data name="JPEG" xml:space="preserve">+ <value>JPEG</value>+ </data>+ <data name="PNG" xml:space="preserve">+ <value>PNG</value>+ </data>+ <data name="BMP" xml:space="preserve">+ <value>BMP</value>+ </data>+ <data name="GIF" xml:space="preserve">+ <value>GIF</value>+ </data>+ <data name="HEIF" xml:space="preserve">+ <value>HEIF</value>+ </data>+ <data name="JPEGXR" xml:space="preserve">+ <value>JPEG XR</value>+ </data>+ <data name="TIFF" xml:space="preserve">+ <value>TIFF</value>+ </data>+ <data name="ErrorMessage" xml:space="preserve">+ <value>An unexpected error has occurred, the conversion may not have been performed.</value>+ </data>+</root>\ No newline at end of filediff --git a/src/dev/impl/DevToys/Strings/en-US/ImageConverter.resw b/src/dev/impl/DevToys/Strings/en-US/ImageConverter.reswnew file mode 100644index 000000000..ca2eeb44f--- /dev/null+++ b/src/dev/impl/DevToys/Strings/en-US/ImageConverter.resw@@ -0,0 +1,205 @@+<?xml version="1.0" encoding="utf-8"?>+<root>+ <!--+ Microsoft ResX Schema++ Version 2.0++ The primary goals of this format is to allow a simple XML format+ that is mostly human readable. The generation and parsing of the+ various data types are done through the TypeConverter classes+ associated with the data types.++ Example:++ ... ado.net/XML headers & schema ...+ <resheader name="resmimetype">text/microsoft-resx</resheader>+ <resheader name="version">2.0</resheader>+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">+ <value>[base64 mime encoded serialized .NET Framework object]</value>+ </data>+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>+ <comment>This is a comment</comment>+ </data>++ There are any number of "resheader" rows that contain simple+ name/value pairs.++ Each data row contains a name, and value. The row also contains a+ type or mimetype. Type corresponds to a .NET class that support+ text/value conversion through the TypeConverter architecture.+ Classes that don't support this are serialized and stored with the+ mimetype set.++ The mimetype is used for serialized objects, and tells the+ ResXResourceReader how to depersist the object. This is currently not+ extensible. For a given mimetype the value must be set accordingly:++ Note - application/x-microsoft.net.object.binary.base64 is the format+ that the ResXResourceWriter will generate, however the reader can+ read any of the formats listed below.++ mimetype: application/x-microsoft.net.object.binary.base64+ value : The object must be serialized with+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter+ : and then encoded with base64 encoding.++ mimetype: application/x-microsoft.net.object.soap.base64+ value : The object must be serialized with+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter+ : and then encoded with base64 encoding.++ mimetype: application/x-microsoft.net.object.bytearray.base64+ value : The object must be serialized into a byte array+ : using a System.ComponentModel.TypeConverter+ : and then encoded with base64 encoding.+ -->+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />+ <xsd:element name="root" msdata:IsDataSet="true">+ <xsd:complexType>+ <xsd:choice maxOccurs="unbounded">+ <xsd:element name="metadata">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" />+ </xsd:sequence>+ <xsd:attribute name="name" use="required" type="xsd:string" />+ <xsd:attribute name="type" type="xsd:string" />+ <xsd:attribute name="mimetype" type="xsd:string" />+ <xsd:attribute ref="xml:space" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="assembly">+ <xsd:complexType>+ <xsd:attribute name="alias" type="xsd:string" />+ <xsd:attribute name="name" type="xsd:string" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="data">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />+ </xsd:sequence>+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />+ <xsd:attribute ref="xml:space" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="resheader">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />+ </xsd:sequence>+ <xsd:attribute name="name" type="xsd:string" use="required" />+ </xsd:complexType>+ </xsd:element>+ </xsd:choice>+ </xsd:complexType>+ </xsd:element>+ </xsd:schema>+ <resheader name="resmimetype">+ <value>text/microsoft-resx</value>+ </resheader>+ <resheader name="version">+ <value>2.0</value>+ </resheader>+ <resheader name="reader">+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>+ </resheader>+ <resheader name="writer">+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>+ </resheader>+ <data name="AccessibleName" xml:space="preserve">+ <value>Image Converter tool</value>+ </data>+ <data name="Cancel" xml:space="preserve">+ <value>Cancel</value>+ </data>+ <data name="Configuration" xml:space="preserve">+ <value>Configuration</value>+ </data>+ <data name="Delete" xml:space="preserve">+ <value>Delete</value>+ </data>+ <data name="DeleteAll" xml:space="preserve">+ <value>Delete all</value>+ </data>+ <data name="DetailsTitle" xml:space="preserve">+ <value>Details</value>+ </data>+ <data name="MenuDisplayName" xml:space="preserve">+ <value>Image Converter</value>+ </data>+ <data name="FileSizeDisplay" xml:space="preserve">+ <value>{0:0.##} {1}</value>+ <comment>{0} is a decimal number representing a file size. {1} is a unit, like Bytes, KB, MB, GB, TB</comment>+ </data>+ <data name="InvalidSelectedFiles" xml:space="preserve">+ <value>Only .png, .jpg and .jpeg files can be used.</value>+ </data>+ <data name="OK" xml:space="preserve">+ <value>OK</value>+ </data>+ <data name="SaveAll" xml:space="preserve">+ <value>Save all</value>+ </data>+ <data name="SaveAs" xml:space="preserve">+ <value>Save as</value>+ </data>+ <data name="SeeErrorMessage" xml:space="preserve">+ <value>See details</value>+ </data>+ <data name="SelectFilesInstruction1" xml:space="preserve">+ <value>Drag & drop image files here</value>+ </data>+ <data name="SelectFilesInstruction2" xml:space="preserve">+ <value>or</value>+ </data>+ <data name="SelectFilesInstruction3" xml:space="preserve">+ <value>Browse files</value>+ </data>+ <data name="Description" xml:space="preserve">+ <value>Lossless image converter</value>+ </data>+ <data name="SearchDisplayName" xml:space="preserve">+ <value>Image Converter</value>+ </data>+ <data name="ConversionTitle" xml:space="preserve">+ <value>Conversion</value>+ </data>+ <data name="ConvertedFormatDescription" xml:space="preserve">+ <value>Select the converted file format</value>+ </data>+ <data name="JPEG" xml:space="preserve">+ <value>JPEG</value>+ </data>+ <data name="PNG" xml:space="preserve">+ <value>PNG</value>+ </data>+ <data name="BMP" xml:space="preserve">+ <value>BMP</value>+ </data>+ <data name="GIF" xml:space="preserve">+ <value>GIF</value>+ </data>+ <data name="HEIF" xml:space="preserve">+ <value>HEIF</value>+ </data>+ <data name="JPEGXR" xml:space="preserve">+ <value>JPEG XR</value>+ </data>+ <data name="TIFF" xml:space="preserve">+ <value>TIFF</value>+ </data>+ <data name="ErrorMessage" xml:space="preserve">+ <value>An unexpected error has occurred, the conversion may not have been performed.</value>+ </data>+</root>\ No newline at end of filediff --git a/src/dev/impl/DevToys/Strings/fr-FR/ImageConverter.resw b/src/dev/impl/DevToys/Strings/fr-FR/ImageConverter.reswnew file mode 100644index 000000000..ca2eeb44f--- /dev/null+++ b/src/dev/impl/DevToys/Strings/fr-FR/ImageConverter.resw@@ -0,0 +1,205 @@+<?xml version="1.0" encoding="utf-8"?>+<root>+ <!--+ Microsoft ResX Schema++ Version 2.0++ The primary goals of this format is to allow a simple XML format+ that is mostly human readable. The generation and parsing of the+ various data types are done through the TypeConverter classes+ associated with the data types.++ Example:++ ... ado.net/XML headers & schema ...+ <resheader name="resmimetype">text/microsoft-resx</resheader>+ <resheader name="version">2.0</resheader>+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">+ <value>[base64 mime encoded serialized .NET Framework object]</value>+ </data>+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>+ <comment>This is a comment</comment>+ </data>++ There are any number of "resheader" rows that contain simple+ name/value pairs.++ Each data row contains a name, and value. The row also contains a+ type or mimetype. Type corresponds to a .NET class that support+ text/value conversion through the TypeConverter architecture.+ Classes that don't support this are serialized and stored with the+ mimetype set.++ The mimetype is used for serialized objects, and tells the+ ResXResourceReader how to depersist the object. This is currently not+ extensible. For a given mimetype the value must be set accordingly:++ Note - application/x-microsoft.net.object.binary.base64 is the format+ that the ResXResourceWriter will generate, however the reader can+ read any of the formats listed below.++ mimetype: application/x-microsoft.net.object.binary.base64+ value : The object must be serialized with+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter+ : and then encoded with base64 encoding.++ mimetype: application/x-microsoft.net.object.soap.base64+ value : The object must be serialized with+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter+ : and then encoded with base64 encoding.++ mimetype: application/x-microsoft.net.object.bytearray.base64+ value : The object must be serialized into a byte array+ : using a System.ComponentModel.TypeConverter+ : and then encoded with base64 encoding.+ -->+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />+ <xsd:element name="root" msdata:IsDataSet="true">+ <xsd:complexType>+ <xsd:choice maxOccurs="unbounded">+ <xsd:element name="metadata">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" />+ </xsd:sequence>+ <xsd:attribute name="name" use="required" type="xsd:string" />+ <xsd:attribute name="type" type="xsd:string" />+ <xsd:attribute name="mimetype" type="xsd:string" />+ <xsd:attribute ref="xml:space" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="assembly">+ <xsd:complexType>+ <xsd:attribute name="alias" type="xsd:string" />+ <xsd:attribute name="name" type="xsd:string" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="data">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />+ </xsd:sequence>+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />+ <xsd:attribute ref="xml:space" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="resheader">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />+ </xsd:sequence>+ <xsd:attribute name="name" type="xsd:string" use="required" />+ </xsd:complexType>+ </xsd:element>+ </xsd:choice>+ </xsd:complexType>+ </xsd:element>+ </xsd:schema>+ <resheader name="resmimetype">+ <value>text/microsoft-resx</value>+ </resheader>+ <resheader name="version">+ <value>2.0</value>+ </resheader>+ <resheader name="reader">+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>+ </resheader>+ <resheader name="writer">+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>+ </resheader>+ <data name="AccessibleName" xml:space="preserve">+ <value>Image Converter tool</value>+ </data>+ <data name="Cancel" xml:space="preserve">+ <value>Cancel</value>+ </data>+ <data name="Configuration" xml:space="preserve">+ <value>Configuration</value>+ </data>+ <data name="Delete" xml:space="preserve">+ <value>Delete</value>+ </data>+ <data name="DeleteAll" xml:space="preserve">+ <value>Delete all</value>+ </data>+ <data name="DetailsTitle" xml:space="preserve">+ <value>Details</value>+ </data>+ <data name="MenuDisplayName" xml:space="preserve">+ <value>Image Converter</value>+ </data>+ <data name="FileSizeDisplay" xml:space="preserve">+ <value>{0:0.##} {1}</value>+ <comment>{0} is a decimal number representing a file size. {1} is a unit, like Bytes, KB, MB, GB, TB</comment>+ </data>+ <data name="InvalidSelectedFiles" xml:space="preserve">+ <value>Only .png, .jpg and .jpeg files can be used.</value>+ </data>+ <data name="OK" xml:space="preserve">+ <value>OK</value>+ </data>+ <data name="SaveAll" xml:space="preserve">+ <value>Save all</value>+ </data>+ <data name="SaveAs" xml:space="preserve">+ <value>Save as</value>+ </data>+ <data name="SeeErrorMessage" xml:space="preserve">+ <value>See details</value>+ </data>+ <data name="SelectFilesInstruction1" xml:space="preserve">+ <value>Drag & drop image files here</value>+ </data>+ <data name="SelectFilesInstruction2" xml:space="preserve">+ <value>or</value>+ </data>+ <data name="SelectFilesInstruction3" xml:space="preserve">+ <value>Browse files</value>+ </data>+ <data name="Description" xml:space="preserve">+ <value>Lossless image converter</value>+ </data>+ <data name="SearchDisplayName" xml:space="preserve">+ <value>Image Converter</value>+ </data>+ <data name="ConversionTitle" xml:space="preserve">+ <value>Conversion</value>+ </data>+ <data name="ConvertedFormatDescription" xml:space="preserve">+ <value>Select the converted file format</value>+ </data>+ <data name="JPEG" xml:space="preserve">+ <value>JPEG</value>+ </data>+ <data name="PNG" xml:space="preserve">+ <value>PNG</value>+ </data>+ <data name="BMP" xml:space="preserve">+ <value>BMP</value>+ </data>+ <data name="GIF" xml:space="preserve">+ <value>GIF</value>+ </data>+ <data name="HEIF" xml:space="preserve">+ <value>HEIF</value>+ </data>+ <data name="JPEGXR" xml:space="preserve">+ <value>JPEG XR</value>+ </data>+ <data name="TIFF" xml:space="preserve">+ <value>TIFF</value>+ </data>+ <data name="ErrorMessage" xml:space="preserve">+ <value>An unexpected error has occurred, the conversion may not have been performed.</value>+ </data>+</root>\ No newline at end of filediff --git a/src/dev/impl/DevToys/Strings/pl-PL/ImageConverter.resw b/src/dev/impl/DevToys/Strings/pl-PL/ImageConverter.reswnew file mode 100644index 000000000..ca2eeb44f--- /dev/null+++ b/src/dev/impl/DevToys/Strings/pl-PL/ImageConverter.resw@@ -0,0 +1,205 @@+<?xml version="1.0" encoding="utf-8"?>+<root>+ <!--+ Microsoft ResX Schema++ Version 2.0++ The primary goals of this format is to allow a simple XML format+ that is mostly human readable. The generation and parsing of the+ various data types are done through the TypeConverter classes+ associated with the data types.++ Example:++ ... ado.net/XML headers & schema ...+ <resheader name="resmimetype">text/microsoft-resx</resheader>+ <resheader name="version">2.0</resheader>+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">+ <value>[base64 mime encoded serialized .NET Framework object]</value>+ </data>+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>+ <comment>This is a comment</comment>+ </data>++ There are any number of "resheader" rows that contain simple+ name/value pairs.++ Each data row contains a name, and value. The row also contains a+ type or mimetype. Type corresponds to a .NET class that support+ text/value conversion through the TypeConverter architecture.+ Classes that don't support this are serialized and stored with the+ mimetype set.++ The mimetype is used for serialized objects, and tells the+ ResXResourceReader how to depersist the object. This is currently not+ extensible. For a given mimetype the value must be set accordingly:++ Note - application/x-microsoft.net.object.binary.base64 is the format+ that the ResXResourceWriter will generate, however the reader can+ read any of the formats listed below.++ mimetype: application/x-microsoft.net.object.binary.base64+ value : The object must be serialized with+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter+ : and then encoded with base64 encoding.++ mimetype: application/x-microsoft.net.object.soap.base64+ value : The object must be serialized with+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter+ : and then encoded with base64 encoding.++ mimetype: application/x-microsoft.net.object.bytearray.base64+ value : The object must be serialized into a byte array+ : using a System.ComponentModel.TypeConverter+ : and then encoded with base64 encoding.+ -->+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />+ <xsd:element name="root" msdata:IsDataSet="true">+ <xsd:complexType>+ <xsd:choice maxOccurs="unbounded">+ <xsd:element name="metadata">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" />+ </xsd:sequence>+ <xsd:attribute name="name" use="required" type="xsd:string" />+ <xsd:attribute name="type" type="xsd:string" />+ <xsd:attribute name="mimetype" type="xsd:string" />+ <xsd:attribute ref="xml:space" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="assembly">+ <xsd:complexType>+ <xsd:attribute name="alias" type="xsd:string" />+ <xsd:attribute name="name" type="xsd:string" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="data">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />+ </xsd:sequence>+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />+ <xsd:attribute ref="xml:space" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="resheader">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />+ </xsd:sequence>+ <xsd:attribute name="name" type="xsd:string" use="required" />+ </xsd:complexType>+ </xsd:element>+ </xsd:choice>+ </xsd:complexType>+ </xsd:element>+ </xsd:schema>+ <resheader name="resmimetype">+ <value>text/microsoft-resx</value>+ </resheader>+ <resheader name="version">+ <value>2.0</value>+ </resheader>+ <resheader name="reader">+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>+ </resheader>+ <resheader name="writer">+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>+ </resheader>+ <data name="AccessibleName" xml:space="preserve">+ <value>Image Converter tool</value>+ </data>+ <data name="Cancel" xml:space="preserve">+ <value>Cancel</value>+ </data>+ <data name="Configuration" xml:space="preserve">+ <value>Configuration</value>+ </data>+ <data name="Delete" xml:space="preserve">+ <value>Delete</value>+ </data>+ <data name="DeleteAll" xml:space="preserve">+ <value>Delete all</value>+ </data>+ <data name="DetailsTitle" xml:space="preserve">+ <value>Details</value>+ </data>+ <data name="MenuDisplayName" xml:space="preserve">+ <value>Image Converter</value>+ </data>+ <data name="FileSizeDisplay" xml:space="preserve">+ <value>{0:0.##} {1}</value>+ <comment>{0} is a decimal number representing a file size. {1} is a unit, like Bytes, KB, MB, GB, TB</comment>+ </data>+ <data name="InvalidSelectedFiles" xml:space="preserve">+ <value>Only .png, .jpg and .jpeg files can be used.</value>+ </data>+ <data name="OK" xml:space="preserve">+ <value>OK</value>+ </data>+ <data name="SaveAll" xml:space="preserve">+ <value>Save all</value>+ </data>+ <data name="SaveAs" xml:space="preserve">+ <value>Save as</value>+ </data>+ <data name="SeeErrorMessage" xml:space="preserve">+ <value>See details</value>+ </data>+ <data name="SelectFilesInstruction1" xml:space="preserve">+ <value>Drag & drop image files here</value>+ </data>+ <data name="SelectFilesInstruction2" xml:space="preserve">+ <value>or</value>+ </data>+ <data name="SelectFilesInstruction3" xml:space="preserve">+ <value>Browse files</value>+ </data>+ <data name="Description" xml:space="preserve">+ <value>Lossless image converter</value>+ </data>+ <data name="SearchDisplayName" xml:space="preserve">+ <value>Image Converter</value>+ </data>+ <data name="ConversionTitle" xml:space="preserve">+ <value>Conversion</value>+ </data>+ <data name="ConvertedFormatDescription" xml:space="preserve">+ <value>Select the converted file format</value>+ </data>+ <data name="JPEG" xml:space="preserve">+ <value>JPEG</value>+ </data>+ <data name="PNG" xml:space="preserve">+ <value>PNG</value>+ </data>+ <data name="BMP" xml:space="preserve">+ <value>BMP</value>+ </data>+ <data name="GIF" xml:space="preserve">+ <value>GIF</value>+ </data>+ <data name="HEIF" xml:space="preserve">+ <value>HEIF</value>+ </data>+ <data name="JPEGXR" xml:space="preserve">+ <value>JPEG XR</value>+ </data>+ <data name="TIFF" xml:space="preserve">+ <value>TIFF</value>+ </data>+ <data name="ErrorMessage" xml:space="preserve">+ <value>An unexpected error has occurred, the conversion may not have been performed.</value>+ </data>+</root>\ No newline at end of filediff --git a/src/dev/impl/DevToys/Strings/pt-PT/ImageConverter.resw b/src/dev/impl/DevToys/Strings/pt-PT/ImageConverter.reswnew file mode 100644index 000000000..ca2eeb44f--- /dev/null+++ b/src/dev/impl/DevToys/Strings/pt-PT/ImageConverter.resw@@ -0,0 +1,205 @@+<?xml version="1.0" encoding="utf-8"?>+<root>+ <!--+ Microsoft ResX Schema++ Version 2.0++ The primary goals of this format is to allow a simple XML format+ that is mostly human readable. The generation and parsing of the+ various data types are done through the TypeConverter classes+ associated with the data types.++ Example:++ ... ado.net/XML headers & schema ...+ <resheader name="resmimetype">text/microsoft-resx</resheader>+ <resheader name="version">2.0</resheader>+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">+ <value>[base64 mime encoded serialized .NET Framework object]</value>+ </data>+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>+ <comment>This is a comment</comment>+ </data>++ There are any number of "resheader" rows that contain simple+ name/value pairs.++ Each data row contains a name, and value. The row also contains a+ type or mimetype. Type corresponds to a .NET class that support+ text/value conversion through the TypeConverter architecture.+ Classes that don't support this are serialized and stored with the+ mimetype set.++ The mimetype is used for serialized objects, and tells the+ ResXResourceReader how to depersist the object. This is currently not+ extensible. For a given mimetype the value must be set accordingly:++ Note - application/x-microsoft.net.object.binary.base64 is the format+ that the ResXResourceWriter will generate, however the reader can+ read any of the formats listed below.++ mimetype: application/x-microsoft.net.object.binary.base64+ value : The object must be serialized with+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter+ : and then encoded with base64 encoding.++ mimetype: application/x-microsoft.net.object.soap.base64+ value : The object must be serialized with+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter+ : and then encoded with base64 encoding.++ mimetype: application/x-microsoft.net.object.bytearray.base64+ value : The object must be serialized into a byte array+ : using a System.ComponentModel.TypeConverter+ : and then encoded with base64 encoding.+ -->+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />+ <xsd:element name="root" msdata:IsDataSet="true">+ <xsd:complexType>+ <xsd:choice maxOccurs="unbounded">+ <xsd:element name="metadata">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" />+ </xsd:sequence>+ <xsd:attribute name="name" use="required" type="xsd:string" />+ <xsd:attribute name="type" type="xsd:string" />+ <xsd:attribute name="mimetype" type="xsd:string" />+ <xsd:attribute ref="xml:space" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="assembly">+ <xsd:complexType>+ <xsd:attribute name="alias" type="xsd:string" />+ <xsd:attribute name="name" type="xsd:string" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="data">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />+ </xsd:sequence>+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />+ <xsd:attribute ref="xml:space" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="resheader">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />+ </xsd:sequence>+ <xsd:attribute name="name" type="xsd:string" use="required" />+ </xsd:complexType>+ </xsd:element>+ </xsd:choice>+ </xsd:complexType>+ </xsd:element>+ </xsd:schema>+ <resheader name="resmimetype">+ <value>text/microsoft-resx</value>+ </resheader>+ <resheader name="version">+ <value>2.0</value>+ </resheader>+ <resheader name="reader">+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>+ </resheader>+ <resheader name="writer">+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>+ </resheader>+ <data name="AccessibleName" xml:space="preserve">+ <value>Image Converter tool</value>+ </data>+ <data name="Cancel" xml:space="preserve">+ <value>Cancel</value>+ </data>+ <data name="Configuration" xml:space="preserve">+ <value>Configuration</value>+ </data>+ <data name="Delete" xml:space="preserve">+ <value>Delete</value>+ </data>+ <data name="DeleteAll" xml:space="preserve">+ <value>Delete all</value>+ </data>+ <data name="DetailsTitle" xml:space="preserve">+ <value>Details</value>+ </data>+ <data name="MenuDisplayName" xml:space="preserve">+ <value>Image Converter</value>+ </data>+ <data name="FileSizeDisplay" xml:space="preserve">+ <value>{0:0.##} {1}</value>+ <comment>{0} is a decimal number representing a file size. {1} is a unit, like Bytes, KB, MB, GB, TB</comment>+ </data>+ <data name="InvalidSelectedFiles" xml:space="preserve">+ <value>Only .png, .jpg and .jpeg files can be used.</value>+ </data>+ <data name="OK" xml:space="preserve">+ <value>OK</value>+ </data>+ <data name="SaveAll" xml:space="preserve">+ <value>Save all</value>+ </data>+ <data name="SaveAs" xml:space="preserve">+ <value>Save as</value>+ </data>+ <data name="SeeErrorMessage" xml:space="preserve">+ <value>See details</value>+ </data>+ <data name="SelectFilesInstruction1" xml:space="preserve">+ <value>Drag & drop image files here</value>+ </data>+ <data name="SelectFilesInstruction2" xml:space="preserve">+ <value>or</value>+ </data>+ <data name="SelectFilesInstruction3" xml:space="preserve">+ <value>Browse files</value>+ </data>+ <data name="Description" xml:space="preserve">+ <value>Lossless image converter</value>+ </data>+ <data name="SearchDisplayName" xml:space="preserve">+ <value>Image Converter</value>+ </data>+ <data name="ConversionTitle" xml:space="preserve">+ <value>Conversion</value>+ </data>+ <data name="ConvertedFormatDescription" xml:space="preserve">+ <value>Select the converted file format</value>+ </data>+ <data name="JPEG" xml:space="preserve">+ <value>JPEG</value>+ </data>+ <data name="PNG" xml:space="preserve">+ <value>PNG</value>+ </data>+ <data name="BMP" xml:space="preserve">+ <value>BMP</value>+ </data>+ <data name="GIF" xml:space="preserve">+ <value>GIF</value>+ </data>+ <data name="HEIF" xml:space="preserve">+ <value>HEIF</value>+ </data>+ <data name="JPEGXR" xml:space="preserve">+ <value>JPEG XR</value>+ </data>+ <data name="TIFF" xml:space="preserve">+ <value>TIFF</value>+ </data>+ <data name="ErrorMessage" xml:space="preserve">+ <value>An unexpected error has occurred, the conversion may not have been performed.</value>+ </data>+</root>\ No newline at end of filediff --git a/src/dev/impl/DevToys/Strings/ru-RU/ImageConverter.resw b/src/dev/impl/DevToys/Strings/ru-RU/ImageConverter.reswnew file mode 100644index 000000000..ca2eeb44f--- /dev/null+++ b/src/dev/impl/DevToys/Strings/ru-RU/ImageConverter.resw@@ -0,0 +1,205 @@+<?xml version="1.0" encoding="utf-8"?>+<root>+ <!--+ Microsoft ResX Schema++ Version 2.0++ The primary goals of this format is to allow a simple XML format+ that is mostly human readable. The generation and parsing of the+ various data types are done through the TypeConverter classes+ associated with the data types.++ Example:++ ... ado.net/XML headers & schema ...+ <resheader name="resmimetype">text/microsoft-resx</resheader>+ <resheader name="version">2.0</resheader>+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">+ <value>[base64 mime encoded serialized .NET Framework object]</value>+ </data>+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>+ <comment>This is a comment</comment>+ </data>++ There are any number of "resheader" rows that contain simple+ name/value pairs.++ Each data row contains a name, and value. The row also contains a+ type or mimetype. Type corresponds to a .NET class that support+ text/value conversion through the TypeConverter architecture.+ Classes that don't support this are serialized and stored with the+ mimetype set.++ The mimetype is used for serialized objects, and tells the+ ResXResourceReader how to depersist the object. This is currently not+ extensible. For a given mimetype the value must be set accordingly:++ Note - application/x-microsoft.net.object.binary.base64 is the format+ that the ResXResourceWriter will generate, however the reader can+ read any of the formats listed below.++ mimetype: application/x-microsoft.net.object.binary.base64+ value : The object must be serialized with+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter+ : and then encoded with base64 encoding.++ mimetype: application/x-microsoft.net.object.soap.base64+ value : The object must be serialized with+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter+ : and then encoded with base64 encoding.++ mimetype: application/x-microsoft.net.object.bytearray.base64+ value : The object must be serialized into a byte array+ : using a System.ComponentModel.TypeConverter+ : and then encoded with base64 encoding.+ -->+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />+ <xsd:element name="root" msdata:IsDataSet="true">+ <xsd:complexType>+ <xsd:choice maxOccurs="unbounded">+ <xsd:element name="metadata">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" />+ </xsd:sequence>+ <xsd:attribute name="name" use="required" type="xsd:string" />+ <xsd:attribute name="type" type="xsd:string" />+ <xsd:attribute name="mimetype" type="xsd:string" />+ <xsd:attribute ref="xml:space" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="assembly">+ <xsd:complexType>+ <xsd:attribute name="alias" type="xsd:string" />+ <xsd:attribute name="name" type="xsd:string" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="data">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />+ </xsd:sequence>+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />+ <xsd:attribute ref="xml:space" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="resheader">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />+ </xsd:sequence>+ <xsd:attribute name="name" type="xsd:string" use="required" />+ </xsd:complexType>+ </xsd:element>+ </xsd:choice>+ </xsd:complexType>+ </xsd:element>+ </xsd:schema>+ <resheader name="resmimetype">+ <value>text/microsoft-resx</value>+ </resheader>+ <resheader name="version">+ <value>2.0</value>+ </resheader>+ <resheader name="reader">+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>+ </resheader>+ <resheader name="writer">+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>+ </resheader>+ <data name="AccessibleName" xml:space="preserve">+ <value>Image Converter tool</value>+ </data>+ <data name="Cancel" xml:space="preserve">+ <value>Cancel</value>+ </data>+ <data name="Configuration" xml:space="preserve">+ <value>Configuration</value>+ </data>+ <data name="Delete" xml:space="preserve">+ <value>Delete</value>+ </data>+ <data name="DeleteAll" xml:space="preserve">+ <value>Delete all</value>+ </data>+ <data name="DetailsTitle" xml:space="preserve">+ <value>Details</value>+ </data>+ <data name="MenuDisplayName" xml:space="preserve">+ <value>Image Converter</value>+ </data>+ <data name="FileSizeDisplay" xml:space="preserve">+ <value>{0:0.##} {1}</value>+ <comment>{0} is a decimal number representing a file size. {1} is a unit, like Bytes, KB, MB, GB, TB</comment>+ </data>+ <data name="InvalidSelectedFiles" xml:space="preserve">+ <value>Only .png, .jpg and .jpeg files can be used.</value>+ </data>+ <data name="OK" xml:space="preserve">+ <value>OK</value>+ </data>+ <data name="SaveAll" xml:space="preserve">+ <value>Save all</value>+ </data>+ <data name="SaveAs" xml:space="preserve">+ <value>Save as</value>+ </data>+ <data name="SeeErrorMessage" xml:space="preserve">+ <value>See details</value>+ </data>+ <data name="SelectFilesInstruction1" xml:space="preserve">+ <value>Drag & drop image files here</value>+ </data>+ <data name="SelectFilesInstruction2" xml:space="preserve">+ <value>or</value>+ </data>+ <data name="SelectFilesInstruction3" xml:space="preserve">+ <value>Browse files</value>+ </data>+ <data name="Description" xml:space="preserve">+ <value>Lossless image converter</value>+ </data>+ <data name="SearchDisplayName" xml:space="preserve">+ <value>Image Converter</value>+ </data>+ <data name="ConversionTitle" xml:space="preserve">+ <value>Conversion</value>+ </data>+ <data name="ConvertedFormatDescription" xml:space="preserve">+ <value>Select the converted file format</value>+ </data>+ <data name="JPEG" xml:space="preserve">+ <value>JPEG</value>+ </data>+ <data name="PNG" xml:space="preserve">+ <value>PNG</value>+ </data>+ <data name="BMP" xml:space="preserve">+ <value>BMP</value>+ </data>+ <data name="GIF" xml:space="preserve">+ <value>GIF</value>+ </data>+ <data name="HEIF" xml:space="preserve">+ <value>HEIF</value>+ </data>+ <data name="JPEGXR" xml:space="preserve">+ <value>JPEG XR</value>+ </data>+ <data name="TIFF" xml:space="preserve">+ <value>TIFF</value>+ </data>+ <data name="ErrorMessage" xml:space="preserve">+ <value>An unexpected error has occurred, the conversion may not have been performed.</value>+ </data>+</root>\ No newline at end of filediff --git a/src/dev/impl/DevToys/Strings/zh-Hans/ImageConverter.resw b/src/dev/impl/DevToys/Strings/zh-Hans/ImageConverter.reswnew file mode 100644index 000000000..ca2eeb44f--- /dev/null+++ b/src/dev/impl/DevToys/Strings/zh-Hans/ImageConverter.resw@@ -0,0 +1,205 @@+<?xml version="1.0" encoding="utf-8"?>+<root>+ <!--+ Microsoft ResX Schema++ Version 2.0++ The primary goals of this format is to allow a simple XML format+ that is mostly human readable. The generation and parsing of the+ various data types are done through the TypeConverter classes+ associated with the data types.++ Example:++ ... ado.net/XML headers & schema ...+ <resheader name="resmimetype">text/microsoft-resx</resheader>+ <resheader name="version">2.0</resheader>+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">+ <value>[base64 mime encoded serialized .NET Framework object]</value>+ </data>+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>+ <comment>This is a comment</comment>+ </data>++ There are any number of "resheader" rows that contain simple+ name/value pairs.++ Each data row contains a name, and value. The row also contains a+ type or mimetype. Type corresponds to a .NET class that support+ text/value conversion through the TypeConverter architecture.+ Classes that don't support this are serialized and stored with the+ mimetype set.++ The mimetype is used for serialized objects, and tells the+ ResXResourceReader how to depersist the object. This is currently not+ extensible. For a given mimetype the value must be set accordingly:++ Note - application/x-microsoft.net.object.binary.base64 is the format+ that the ResXResourceWriter will generate, however the reader can+ read any of the formats listed below.++ mimetype: application/x-microsoft.net.object.binary.base64+ value : The object must be serialized with+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter+ : and then encoded with base64 encoding.++ mimetype: application/x-microsoft.net.object.soap.base64+ value : The object must be serialized with+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter+ : and then encoded with base64 encoding.++ mimetype: application/x-microsoft.net.object.bytearray.base64+ value : The object must be serialized into a byte array+ : using a System.ComponentModel.TypeConverter+ : and then encoded with base64 encoding.+ -->+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />+ <xsd:element name="root" msdata:IsDataSet="true">+ <xsd:complexType>+ <xsd:choice maxOccurs="unbounded">+ <xsd:element name="metadata">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" />+ </xsd:sequence>+ <xsd:attribute name="name" use="required" type="xsd:string" />+ <xsd:attribute name="type" type="xsd:string" />+ <xsd:attribute name="mimetype" type="xsd:string" />+ <xsd:attribute ref="xml:space" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="assembly">+ <xsd:complexType>+ <xsd:attribute name="alias" type="xsd:string" />+ <xsd:attribute name="name" type="xsd:string" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="data">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />+ </xsd:sequence>+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />+ <xsd:attribute ref="xml:space" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="resheader">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />+ </xsd:sequence>+ <xsd:attribute name="name" type="xsd:string" use="required" />+ </xsd:complexType>+ </xsd:element>+ </xsd:choice>+ </xsd:complexType>+ </xsd:element>+ </xsd:schema>+ <resheader name="resmimetype">+ <value>text/microsoft-resx</value>+ </resheader>+ <resheader name="version">+ <value>2.0</value>+ </resheader>+ <resheader name="reader">+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>+ </resheader>+ <resheader name="writer">+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>+ </resheader>+ <data name="AccessibleName" xml:space="preserve">+ <value>Image Converter tool</value>+ </data>+ <data name="Cancel" xml:space="preserve">+ <value>Cancel</value>+ </data>+ <data name="Configuration" xml:space="preserve">+ <value>Configuration</value>+ </data>+ <data name="Delete" xml:space="preserve">+ <value>Delete</value>+ </data>+ <data name="DeleteAll" xml:space="preserve">+ <value>Delete all</value>+ </data>+ <data name="DetailsTitle" xml:space="preserve">+ <value>Details</value>+ </data>+ <data name="MenuDisplayName" xml:space="preserve">+ <value>Image Converter</value>+ </data>+ <data name="FileSizeDisplay" xml:space="preserve">+ <value>{0:0.##} {1}</value>+ <comment>{0} is a decimal number representing a file size. {1} is a unit, like Bytes, KB, MB, GB, TB</comment>+ </data>+ <data name="InvalidSelectedFiles" xml:space="preserve">+ <value>Only .png, .jpg and .jpeg files can be used.</value>+ </data>+ <data name="OK" xml:space="preserve">+ <value>OK</value>+ </data>+ <data name="SaveAll" xml:space="preserve">+ <value>Save all</value>+ </data>+ <data name="SaveAs" xml:space="preserve">+ <value>Save as</value>+ </data>+ <data name="SeeErrorMessage" xml:space="preserve">+ <value>See details</value>+ </data>+ <data name="SelectFilesInstruction1" xml:space="preserve">+ <value>Drag & drop image files here</value>+ </data>+ <data name="SelectFilesInstruction2" xml:space="preserve">+ <value>or</value>+ </data>+ <data name="SelectFilesInstruction3" xml:space="preserve">+ <value>Browse files</value>+ </data>+ <data name="Description" xml:space="preserve">+ <value>Lossless image converter</value>+ </data>+ <data name="SearchDisplayName" xml:space="preserve">+ <value>Image Converter</value>+ </data>+ <data name="ConversionTitle" xml:space="preserve">+ <value>Conversion</value>+ </data>+ <data name="ConvertedFormatDescription" xml:space="preserve">+ <value>Select the converted file format</value>+ </data>+ <data name="JPEG" xml:space="preserve">+ <value>JPEG</value>+ </data>+ <data name="PNG" xml:space="preserve">+ <value>PNG</value>+ </data>+ <data name="BMP" xml:space="preserve">+ <value>BMP</value>+ </data>+ <data name="GIF" xml:space="preserve">+ <value>GIF</value>+ </data>+ <data name="HEIF" xml:space="preserve">+ <value>HEIF</value>+ </data>+ <data name="JPEGXR" xml:space="preserve">+ <value>JPEG XR</value>+ </data>+ <data name="TIFF" xml:space="preserve">+ <value>TIFF</value>+ </data>+ <data name="ErrorMessage" xml:space="preserve">+ <value>An unexpected error has occurred, the conversion may not have been performed.</value>+ </data>+</root>\ No newline at end of filediff --git a/src/dev/impl/DevToys/ViewModels/Tools/Graphic/ImageConverter/ImageConversionWorkItem.cs b/src/dev/impl/DevToys/ViewModels/Tools/Graphic/ImageConverter/ImageConversionWorkItem.csnew file mode 100644index 000000000..11788d939--- /dev/null+++ b/src/dev/impl/DevToys/ViewModels/Tools/Graphic/ImageConverter/ImageConversionWorkItem.cs@@ -0,0 +1,130 @@+#nullable enable++using System;+using System.Collections.Generic;+using System.IO;+using System.Threading.Tasks;+using DevToys.Core.Threading;+using DevToys.Helpers;+using DevToys.Shared.Core;+using DevToys.Shared.Core.Threading;+using Microsoft.Toolkit.Mvvm.ComponentModel;+using Microsoft.Toolkit.Mvvm.Input;+using Windows.Graphics.Imaging;+using Windows.Storage;+using Windows.Storage.Pickers;+using Windows.Storage.Streams;++namespace DevToys.ViewModels.Tools.ImageConverter+{+ internal sealed class ImageConversionWorkItem : ObservableRecipient+ {+ private string _fileSize = string.Empty;++ internal ImageConverterStrings Strings => LanguageManager.Instance.ImageConverter;++ internal StorageFile File { get; }++ internal string FileSize+ {+ get => _fileSize;+ private set+ {+ ThreadHelper.ThrowIfNotOnUIThread();+ SetProperty(ref _fileSize, value);+ }+ }++ internal event EventHandler? DeleteItemRequested;++ internal ImageConversionWorkItem(StorageFile file)+ {+ Arguments.NotNull(file, nameof(file));++ File = file;++ DeleteCommand = new RelayCommand(ExecuteDeleteCommand);+ SaveCommand = new AsyncRelayCommand<ImageConverterToolViewModel>(ExecuteSaveCommandAsync);++ ComputePropertiesAsync(file).ForgetSafely();+ }++ #region DeleteCommand++ public IRelayCommand DeleteCommand { get; }++ private void ExecuteDeleteCommand()+ {+ DeleteItemRequested?.Invoke(this, EventArgs.Empty);+ }++ #endregion++ #region SaveCommand++ public IAsyncRelayCommand SaveCommand { get; }++ private async Task ExecuteSaveCommandAsync(ImageConverterToolViewModel viewModel)+ {+ string? fileExtension = ImageHelper.GetExtension(viewModel.ConvertedFormat);++ var savePicker = new FileSavePicker+ {+ SuggestedStartLocation = PickerLocationId.ComputerFolder+ };++ savePicker.FileTypeChoices.Add(+ fileExtension.Replace(".", string.Empty).ToUpperInvariant(),+ new List<string>() { fileExtension!.ToLowerInvariant() });++ StorageFile? newFile = await savePicker.PickSaveFileAsync();++ if (newFile is not null)+ {+ await Process(viewModel, newFile);+ }+ }++ #endregion++ public async Task Process(ImageConverterToolViewModel viewModel, StorageFile newFile)+ {+ using (IRandomAccessStream outputStream = await newFile.OpenAsync(FileAccessMode.ReadWrite))+ {+ BitmapEncoder encoder = await ImageHelper.GetEncoderAsync(viewModel.ConvertedFormat, outputStream);+ try+ {+ using (SoftwareBitmap bitmap = await DecodeImageAsync())+ {+ encoder.SetSoftwareBitmap(bitmap);+ await encoder.FlushAsync();+ }+ }+ catch (FileNotFoundException)+ {+ viewModel.IsInfoBarOpen = true;+ }+ }++ DeleteCommand.Execute(this);+ }++ private async Task<SoftwareBitmap> DecodeImageAsync()+ {+ using (IRandomAccessStream stream = await File.OpenAsync(FileAccessMode.Read))+ {+ BitmapDecoder decoder = await BitmapDecoder.CreateAsync(stream);+ return await decoder.GetSoftwareBitmapAsync();+ }+ }++ private async Task ComputePropertiesAsync(StorageFile file)+ {+ await TaskScheduler.Default;++ var storageFileSize = (await file.GetBasicPropertiesAsync()).Size;+ var fileSize = StorageFileHelper.HumanizeFileSize(storageFileSize, Strings.FileSizeDisplay);+ await ThreadHelper.RunOnUIThreadAsync(() => FileSize = fileSize);+ }+ }+}diff --git a/src/dev/impl/DevToys/ViewModels/Tools/Graphic/ImageConverter/ImageConverterToolProvider.cs b/src/dev/impl/DevToys/ViewModels/Tools/Graphic/ImageConverter/ImageConverterToolProvider.csnew file mode 100644index 000000000..6c8069da3--- /dev/null+++ b/src/dev/impl/DevToys/ViewModels/Tools/Graphic/ImageConverter/ImageConverterToolProvider.cs@@ -0,0 +1,47 @@+#nullable enable++using System.Composition;+using DevToys.Shared.Api.Core;+using DevToys.Api.Tools;+using DevToys.Core.Threading;+using Windows.UI.Xaml.Controls;++namespace DevToys.ViewModels.Tools.ImageConverter+{+ [Export(typeof(IToolProvider))]+ [Name("Image Converter")]+ [Parent(GraphicGroupToolProvider.InternalName)]+ [ProtocolName("imageconverter")]+ [Order(1)]+ [NotScrollable]+ internal sealed class ImageConverterToolProvider : ToolProviderBase, IToolProvider+ {+ private readonly IMefProvider _mefProvider;++ public string MenuDisplayName => LanguageManager.Instance.ImageConverter.MenuDisplayName;++ public string? SearchDisplayName => LanguageManager.Instance.ImageConverter.SearchDisplayName;++ public string? Description => LanguageManager.Instance.ImageConverter.Description;++ public string AccessibleName => LanguageManager.Instance.ImageConverter.AccessibleName;++ public TaskCompletionNotifier<IconElement> IconSource => CreateFontIcon("\uF48D");++ [ImportingConstructor]+ public ImageConverterToolProvider(IMefProvider mefProvider)+ {+ _mefProvider = mefProvider;+ }++ public bool CanBeTreatedByTool(string data)+ {+ return false;+ }++ public IToolViewModel CreateTool()+ {+ return _mefProvider.Import<ImageConverterToolViewModel>();+ }+ }+}diff --git a/src/dev/impl/DevToys/ViewModels/Tools/Graphic/ImageConverter/ImageConverterToolViewModel.cs b/src/dev/impl/DevToys/ViewModels/Tools/Graphic/ImageConverter/ImageConverterToolViewModel.csnew file mode 100644index 000000000..358050bef--- /dev/null+++ b/src/dev/impl/DevToys/ViewModels/Tools/Graphic/ImageConverter/ImageConverterToolViewModel.cs@@ -0,0 +1,297 @@+#nullable enable++using System;+using System.Collections.Generic;+using System.Collections.ObjectModel;+using System.Composition;+using System.Linq;+using System.Threading.Tasks;+using DevToys.Api.Tools;+using DevToys.Core;+using DevToys.Core.Threading;+using DevToys.Helpers;+using DevToys.Shared.Core;+using DevToys.Views.Tools.ImageConverter;+using Microsoft.Toolkit.Mvvm.ComponentModel;+using Microsoft.Toolkit.Mvvm.Input;+using Windows.ApplicationModel.DataTransfer;+using Windows.Graphics.Imaging;+using Windows.Storage;+using Windows.Storage.Pickers;+using Windows.Storage.Streams;+using Windows.UI.Xaml;++namespace DevToys.ViewModels.Tools.ImageConverter+{+ [Export(typeof(ImageConverterToolViewModel))]+ public sealed class ImageConverterToolViewModel : ObservableRecipient, IToolViewModel, IDisposable+ {+ private static readonly string[] SupportedFileExtensions = new[] { ".png", ".jpg", ".jpeg", ".bmp" };++ private bool _isSelectFilesAreaHighlithed;+ private bool _hasInvalidFilesSelected;+ private bool _isInfoBarOpen;++ public Type View { get; } = typeof(ImageConverterToolPage);++ public string ConvertedFormat { get; set; }++ internal ObservableCollection<ImageConversionWorkItem> ConversionWorkQueue { get; } = new();++ internal ImageConverterStrings Strings => LanguageManager.Instance.ImageConverter;++ internal string InfoBarMessage => Strings.ErrorMessage;++ internal bool IsSelectFilesAreaHighlithed+ {+ get => _isSelectFilesAreaHighlithed;+ set => SetProperty(ref _isSelectFilesAreaHighlithed, value);+ }++ internal bool HasInvalidFilesSelected+ {+ get => _hasInvalidFilesSelected;+ set => SetProperty(ref _hasInvalidFilesSelected, value);+ }++ internal bool IsInfoBarOpen+ {+ get => _isInfoBarOpen;+ set => SetProperty(ref _isInfoBarOpen, value);+ }++ [ImportingConstructor]+ public ImageConverterToolViewModel()+ {+ SelectFilesAreaDragOverCommand = new RelayCommand<DragEventArgs>(ExecuteSelectFilesAreaDragOverCommand);+ SelectFilesAreaDragLeaveCommand = new RelayCommand<DragEventArgs>(ExecuteSelectFilesAreaDragLeaveCommand);+ SelectFilesAreaDragDropCommand = new AsyncRelayCommand<DragEventArgs>(ExecuteSelectFilesAreaDragDropCommandAsync);+ SelectFilesBrowseCommand = new AsyncRelayCommand(ExecuteSelectFilesBrowseCommandAsync);+ DeleteAllCommand = new RelayCommand(ExecuteDeleteAllCommand);+ SaveAllCommand = new AsyncRelayCommand(ExecuteSaveAllCommandAsync);+ CloseInfoBarButtonCommand = new RelayCommand(ExecuteCloseInfoBarButtonCommand);++ InitializeComboBox();+ }++ private void InitializeComboBox()+ {+ ConvertedFormat = "PNG";+ }++ public void Dispose()+ {+ DeleteAllCommand.Execute(null);+ }++ #region SelectFilesAreaDragOverCommand++ public IRelayCommand<DragEventArgs> SelectFilesAreaDragOverCommand { get; }++ private void ExecuteSelectFilesAreaDragOverCommand(DragEventArgs? parameters)+ {+ Arguments.NotNull(parameters, nameof(parameters));+ if (parameters!.DataView.Contains(StandardDataFormats.StorageItems))+ {+ parameters.AcceptedOperation = DataPackageOperation.Copy;+ parameters.Handled = false;+ }++ IsSelectFilesAreaHighlithed = true;+ HasInvalidFilesSelected = false;+ }++ #endregion++ #region SelectFilesAreaDragLeaveCommand++ public IRelayCommand<DragEventArgs> SelectFilesAreaDragLeaveCommand { get; }++ private void ExecuteSelectFilesAreaDragLeaveCommand(DragEventArgs? parameters)+ {+ IsSelectFilesAreaHighlithed = false;+ HasInvalidFilesSelected = false;+ }++ #endregion++ #region SelectFilesAreaDragDropCommand++ public IAsyncRelayCommand<DragEventArgs> SelectFilesAreaDragDropCommand { get; }++ private async Task ExecuteSelectFilesAreaDragDropCommandAsync(DragEventArgs? parameters)+ {+ try+ {+ Arguments.NotNull(parameters, nameof(parameters));++ await ThreadHelper.RunOnUIThreadAsync(async () =>+ {+ IsSelectFilesAreaHighlithed = false;+ if (!parameters!.DataView.Contains(StandardDataFormats.StorageItems))+ {+ return;+ }++ IReadOnlyList<IStorageItem>? storageItems = await parameters.DataView.GetStorageItemsAsync();+ if (storageItems is null || storageItems.Count == 0)+ {+ return;+ }++ foreach (IStorageItem storageItem in storageItems)+ {+ if (storageItem is StorageFile file)+ {+ if (SupportedFileExtensions.Any(ext => string.Equals(ext, file.FileType, StringComparison.OrdinalIgnoreCase)))+ {+ QueueNewConversionWorkItem(file);+ }+ else+ {+ HasInvalidFilesSelected = true;+ }+ }+ else+ {+ HasInvalidFilesSelected = true;+ }+ }+ }).ConfigureAwait(false);+ }+ catch (Exception ex)+ {+ Logger.LogFault(nameof(ImageConverterToolViewModel), ex, "Unable to recognize files.");+ IsInfoBarOpen = true;+ }+ }++ #endregion++ #region SelectFilesBrowseCommand++ public IAsyncRelayCommand SelectFilesBrowseCommand { get; }++ private async Task ExecuteSelectFilesBrowseCommandAsync()+ {+ try+ {+ await ThreadHelper.RunOnUIThreadAsync(async () =>+ {+ HasInvalidFilesSelected = false;++ var filePicker = new FileOpenPicker+ {+ ViewMode = PickerViewMode.List,+ SuggestedStartLocation = PickerLocationId.ComputerFolder+ };++ for (int i = 0; i < SupportedFileExtensions.Length; i++)+ {+ filePicker.FileTypeFilter.Add(SupportedFileExtensions[i]);+ }++ IReadOnlyList<StorageFile> files = await filePicker.PickMultipleFilesAsync();+ for (int i = 0; i < files.Count; i++)+ {+ QueueNewConversionWorkItem(files[i]);+ }+ });+ }+ catch (Exception ex)+ {+ Logger.LogFault(nameof(ImageConverterToolViewModel), ex, "Unable to browse file(s).");+ IsInfoBarOpen = true;+ }+ }++ #endregion++ #region DeleteAllCommand++ public IRelayCommand DeleteAllCommand { get; }++ private void ExecuteDeleteAllCommand()+ {+ ConversionWorkQueue.Clear();+ }++ #endregion++ #region SaveAllCommand++ public IAsyncRelayCommand SaveAllCommand { get; }++ private async Task ExecuteSaveAllCommandAsync()+ {+ try+ {+ var works = ConversionWorkQueue.ToList();++ var folderPicker = new FolderPicker+ {+ ViewMode = PickerViewMode.List+ };++ StorageFolder? selectedFolder = await folderPicker.PickSingleFolderAsync();++ if (selectedFolder is not null)+ {+ ICollection<Task> conversionTasks = new List<Task>();++ foreach (ImageConversionWorkItem work in works)+ {+ conversionTasks.Add(SaveConversionWorkItem(selectedFolder, work));+ }++ await Task.WhenAll(conversionTasks);+ }+ }+ catch (Exception ex)+ {+ Logger.LogFault(nameof(ImageConverterToolViewModel), ex, "Unable to save all files.");+ IsInfoBarOpen = true;+ }+ }++ #endregion++ #region CloseInfoBarButtonCommand++ public IRelayCommand CloseInfoBarButtonCommand { get; }++ private void ExecuteCloseInfoBarButtonCommand()+ {+ IsInfoBarOpen = false;+ }++ #endregion++ private async Task SaveConversionWorkItem(StorageFolder selectedFolder, ImageConversionWorkItem work)+ {+ StorageFile newFile = await selectedFolder.CreateFileAsync(string.Concat(work.File.DisplayName, ImageHelper.GetExtension(ConvertedFormat)), CreationCollisionOption.ReplaceExisting);+ await work.Process(this, newFile);++ work.DeleteCommand.Execute(null);+ }++ private void QueueNewConversionWorkItem(StorageFile file)+ {+ ThreadHelper.ThrowIfNotOnUIThread();++ if (!ConversionWorkQueue.Any(item => string.Equals(item.File.Path, file.Path, StringComparison.OrdinalIgnoreCase)))+ {+ var workItem = new ImageConversionWorkItem(file);+ workItem.DeleteItemRequested += WorkItem_DeleteItemRequested;+ ConversionWorkQueue.Insert(0, workItem);+ }+ }++ private void WorkItem_DeleteItemRequested(object sender, EventArgs e)+ {+ var workItem = (ImageConversionWorkItem)sender;+ workItem.DeleteItemRequested -= WorkItem_DeleteItemRequested;+ ConversionWorkQueue.Remove(workItem);+ }+ }+}diff --git a/src/dev/impl/DevToys/ViewModels/Tools/Graphic/PngJpgCompressor/ImageCompressionWorkItem.cs b/src/dev/impl/DevToys/ViewModels/Tools/Graphic/PngJpgCompressor/ImageCompressionWorkItem.csindex d17adfb03..47d11bad2 100644--- a/src/dev/impl/DevToys/ViewModels/Tools/Graphic/PngJpgCompressor/ImageCompressionWorkItem.cs+++ b/src/dev/impl/DevToys/ViewModels/Tools/Graphic/PngJpgCompressor/ImageCompressionWorkItem.cs@@ -8,13 +8,13 @@ using System.Threading.Tasks;using DevToys.Api.Core.OOP;using DevToys.Core;using DevToys.Core.Threading;+using DevToys.Helpers;using DevToys.Shared.AppServiceMessages.PngJpgCompressor;using DevToys.Shared.Core;using DevToys.Shared.Core.Threading;using Microsoft.Toolkit.Mvvm.ComponentModel;using Microsoft.Toolkit.Mvvm.Input;using Windows.Storage;-using Windows.Storage.FileProperties;using Windows.Storage.Pickers;using Windows.UI.Xaml.Controls;@@ -22,15 +22,6 @@ namespace DevToys.ViewModels.Tools.PngJpgCompressor{internal sealed class ImageCompressionWorkItem : ObservableRecipient, IDisposable{- private static readonly string[] SizesStrings- = {- LanguageManager.Instance.Common.Bytes,- LanguageManager.Instance.Common.Kilobytes,- LanguageManager.Instance.Common.Megabytes,- LanguageManager.Instance.Common.Gigabytes,- LanguageManager.Instance.Common.Terabytes- };-private readonly CancellationTokenSource _cancellationTokenSource = new();private int _progressionPercentage;private string _originalFileSize = string.Empty;@@ -235,6 +226,15 @@ namespace DevToys.ViewModels.Tools.PngJpgCompressor#endregion+ private async Task ComputePropertiesAsync(StorageFile file)+ {+ await TaskScheduler.Default;++ var storageFileSize = (await file.GetBasicPropertiesAsync()).Size;+ var originalFileSize = StorageFileHelper.HumanizeFileSize(storageFileSize, Strings.FileSizeDisplay);+ await ThreadHelper.RunOnUIThreadAsync(() => OriginalFileSize = originalFileSize);+ }+private async Task ConvertAsync(IAppService appService){await TaskScheduler.Default;@@ -261,7 +261,7 @@ namespace DevToys.ViewModels.Tools.PngJpgCompressor{IsDone = true;CompressionRatio = result.PercentageSaved.ToString("P");- NewFileSize = HumanizeFileSize(result.NewFileSize);+ NewFileSize = StorageFileHelper.HumanizeFileSize(result.NewFileSize, Strings.FileSizeDisplay);}else{@@ -283,30 +283,5 @@ namespace DevToys.ViewModels.Tools.PngJpgCompressor});}}-- private async Task ComputePropertiesAsync(StorageFile file)- {- BasicProperties fileProperties = await file.GetBasicPropertiesAsync();-- string fileSize = HumanizeFileSize(fileProperties.Size);-- await ThreadHelper.RunOnUIThreadAsync(() =>- {- OriginalFileSize = fileSize;- });- }-- private string HumanizeFileSize(double fileSize)- {- int order = 0;- while (fileSize >= 1024 && order < SizesStrings.Length - 1)- {- order++;- fileSize /= 1024;- }-- string fileSizeString = string.Format(Strings.FileSizeDisplay, fileSize, SizesStrings[order]);- return fileSizeString;- }}}diff --git a/src/dev/impl/DevToys/ViewModels/Tools/Graphic/PngJpgCompressor/PngJpgCompressorToolViewModel.cs b/src/dev/impl/DevToys/ViewModels/Tools/Graphic/PngJpgCompressor/PngJpgCompressorToolViewModel.csindex add7189fe..719e4b2b8 100644--- a/src/dev/impl/DevToys/ViewModels/Tools/Graphic/PngJpgCompressor/PngJpgCompressorToolViewModel.cs+++ b/src/dev/impl/DevToys/ViewModels/Tools/Graphic/PngJpgCompressor/PngJpgCompressorToolViewModel.cs@@ -4,7 +4,6 @@ using System;using System.Collections.Generic;using System.Collections.ObjectModel;using System.Composition;-using System.IO;using System.Linq;using System.Threading.Tasks;using DevToys.Api.Core.OOP;@@ -133,9 +132,7 @@ namespace DevToys.ViewModels.Tools.PngJpgCompressorIStorageItem storageItem = storageItems[i];if (storageItem is StorageFile file){- string fileExtension = Path.GetExtension(file.Name);-- if (SupportedFileExtensions.Any(ext => string.Equals(ext, fileExtension, StringComparison.OrdinalIgnoreCase)))+ if (SupportedFileExtensions.Any(ext => string.Equals(ext, file.FileType, StringComparison.OrdinalIgnoreCase))){QueueNewConversion(file);}diff --git a/src/dev/impl/DevToys/Views/Tools/Graphic/ImageConverter/ImageConverterToolPage.xaml b/src/dev/impl/DevToys/Views/Tools/Graphic/ImageConverter/ImageConverterToolPage.xamlnew file mode 100644index 000000000..cf592a465--- /dev/null+++ b/src/dev/impl/DevToys/Views/Tools/Graphic/ImageConverter/ImageConverterToolPage.xaml@@ -0,0 +1,221 @@+<Page+ x:Class="DevToys.Views.Tools.ImageConverter.ImageConverterToolPage"+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"+ xmlns:local="using:DevToys.ViewModels.Tools.ImageConverter"+ xmlns:core="using:Microsoft.Xaml.Interactions.Core"+ xmlns:i="using:Microsoft.Xaml.Interactivity" xmlns:converters="using:DevToys.UI.Converters"+ xmlns:controls="using:DevToys.UI.Controls"+ xmlns:muxc="using:Microsoft.UI.Xaml.Controls"+ mc:Ignorable="d"+ NavigationCacheMode="Required"+ x:Name="ThisPage">+ <Page.Resources>+ <converters:BooleanToVisibilityConverter x:Name="BooleanToVisibilityConverter"/>+ <converters:BooleanToDoubleConverter x:Name="BooleanToDoubleConverter" ValueOnFalse="0.0" ValueOnTrue="1.0"/>++ <Style x:Key="ConversionWorkItemBackgroundGridStyle" TargetType="Grid">+ <Setter Property="CornerRadius" Value="4" />+ <Setter Property="Background" Value="{ThemeResource ExpanderHeaderBackground}" />+ <Setter Property="BorderBrush" Value="{ThemeResource ExpanderHeaderBorderBrush}" />+ <Setter Property="BorderThickness" Value="{ThemeResource ExpanderHeaderBorderThickness}" />+ <Setter Property="HorizontalAlignment" Value="Stretch" />+ <Setter Property="MinHeight" Value="{StaticResource ExpanderMinHeight}" />+ <Setter Property="Padding" Value="{StaticResource ExpanderContentPadding}" />+ </Style>+ </Page.Resources>++ <StackPanel Margin="0,0,0,16" Spacing="12">+ <VisualStateManager.VisualStateGroups>+ <VisualStateGroup>+ <VisualState x:Name="SelectFilesPointerHover">+ <VisualState.StateTriggers>+ <StateTrigger IsActive="{x:Bind ViewModel.IsSelectFilesAreaHighlithed, Mode=OneWay}"/>+ </VisualState.StateTriggers>+ <VisualState.Setters>+ <Setter Target="SelectFilesRectangle.Stroke" Value="{ThemeResource TextControlHeaderForeground}" />+ <Setter Target="SelectFilesRectangle.Fill" Value="{ThemeResource ButtonBackgroundPointerOver}" />+ </VisualState.Setters>+ </VisualState>+ </VisualStateGroup>+ </VisualStateManager.VisualStateGroups>++ <StackPanel.ChildrenTransitions>+ <TransitionCollection>+ <EntranceThemeTransition IsStaggeringEnabled="True" FromVerticalOffset="50"/>+ </TransitionCollection>+ </StackPanel.ChildrenTransitions>++ <StackPanel x:Name="ConfigurationStackPanel" Grid.Row="0" Spacing="4" >+ <TextBlock Style="{StaticResource SubTitleTextBlock}" Text="{x:Bind ViewModel.Strings.Configuration}" />++ <controls:ExpandableSettingControl+ Title="{x:Bind ViewModel.Strings.ConversionTitle}"+ Description="{x:Bind ViewModel.Strings.ConvertedFormatDescription}">+ <controls:ExpandableSettingControl.Icon>+ <FontIcon Glyph="" />+ </controls:ExpandableSettingControl.Icon>+ <ComboBox+ SelectedValuePath="Tag"+ SelectedValue="{x:Bind ViewModel.ConvertedFormat, Mode=TwoWay}">+ <ComboBoxItem Tag="PNG" Content="{x:Bind ViewModel.Strings.PNG}"/>+ <ComboBoxItem Tag="JPEG" Content="{x:Bind ViewModel.Strings.JPEG}"/>+ <ComboBoxItem Tag="BMP" Content="{x:Bind ViewModel.Strings.BMP}"/>+ </ComboBox>+ </controls:ExpandableSettingControl>+ </StackPanel>++ <muxc:InfoBar+ IsOpen="{x:Bind ViewModel.IsInfoBarOpen, Mode=OneWay}"+ Severity="Error"+ Message="{x:Bind ViewModel.InfoBarMessage, Mode=OneWay}"+ CloseButtonCommand="{x:Bind ViewModel.CloseInfoBarButtonCommand}"/>++ <Grid+ Margin="0,12,0,0"+ AllowDrop="True"+ Background="Transparent"+ CornerRadius="4">+ <i:Interaction.Behaviors>+ <core:EventTriggerBehavior EventName="DragOver">+ <core:InvokeCommandAction+ Command="{x:Bind ViewModel.SelectFilesAreaDragOverCommand}"/>+ </core:EventTriggerBehavior>+ <core:EventTriggerBehavior EventName="DragLeave">+ <core:InvokeCommandAction+ Command="{x:Bind ViewModel.SelectFilesAreaDragLeaveCommand}"/>+ </core:EventTriggerBehavior>+ <core:EventTriggerBehavior EventName="Drop">+ <core:InvokeCommandAction+ Command="{x:Bind ViewModel.SelectFilesAreaDragDropCommand}"/>+ </core:EventTriggerBehavior>+ </i:Interaction.Behaviors>+ <Rectangle+ x:Name="SelectFilesRectangle"+ Stroke="{ThemeResource TextControlHeaderForegroundDisabled}"+ StrokeDashArray="4 4"+ StrokeThickness="2"+ Fill="Transparent">+ </Rectangle>+ <StackPanel+ Spacing="8"+ HorizontalAlignment="Center"+ VerticalAlignment="Center"+ Margin="24">+ <TextBlock+ Text="{x:Bind ViewModel.Strings.SelectFilesInstruction1}"+ TextTrimming="CharacterEllipsis"+ TextWrapping="WrapWholeWords"+ HorizontalAlignment="Center"/>+ <TextBlock+ Text="{x:Bind ViewModel.Strings.SelectFilesInstruction2}"+ HorizontalAlignment="Center"/>+ <Button+ Style="{StaticResource AccentButtonStyle}"+ Content="{x:Bind ViewModel.Strings.SelectFilesInstruction3}"+ HorizontalAlignment="Center"+ Command="{x:Bind ViewModel.SelectFilesBrowseCommand}"/>+ <TextBlock+ Text="{x:Bind ViewModel.Strings.InvalidSelectedFiles}"+ HorizontalAlignment="Center"+ FontSize="11"+ Foreground="Red"+ Visibility="{x:Bind ViewModel.HasInvalidFilesSelected, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}}"/>+ </StackPanel>+ </Grid>++ <StackPanel+ Orientation="Horizontal"+ Spacing="8"+ HorizontalAlignment="Right">+ <Button+ Style="{StaticResource AccentButtonStyle}"+ AutomationProperties.Name="{x:Bind ViewModel.Strings.SaveAll}"+ Command="{x:Bind ViewModel.SaveAllCommand}">+ <StackPanel Orientation="Horizontal" Spacing="4">+ <FontIcon Glyph=""/>+ <TextBlock VerticalAlignment="Center" Text="{x:Bind ViewModel.Strings.SaveAll}"/>+ </StackPanel>+ </Button>+ <Button+ AutomationProperties.Name="{x:Bind ViewModel.Strings.DeleteAll}"+ Command="{x:Bind ViewModel.DeleteAllCommand}">+ <StackPanel Orientation="Horizontal" Spacing="4">+ <FontIcon Glyph=""/>+ <TextBlock VerticalAlignment="Center" Text="{x:Bind ViewModel.Strings.DeleteAll}"/>+ </StackPanel>+ </Button>+ </StackPanel>++ <ItemsControl+ ItemsSource="{x:Bind ViewModel.ConversionWorkQueue}">+ <ItemsControl.ItemContainerTransitions>+ <TransitionCollection>+ <AddDeleteThemeTransition />+ </TransitionCollection>+ </ItemsControl.ItemContainerTransitions>+ <ItemsControl.ItemTemplate>+ <DataTemplate x:DataType="local:ImageConversionWorkItem">+ <Grid Style="{StaticResource ConversionWorkItemBackgroundGridStyle}" Margin="0,4,0,0">+ <Grid+ HorizontalAlignment="Stretch"+ VerticalAlignment="Center">+ <Grid.ColumnDefinitions>+ <ColumnDefinition Width="*"/>+ <ColumnDefinition Width="Auto"/>+ <ColumnDefinition Width="Auto"/>+ </Grid.ColumnDefinitions>+ <StackPanel+ Grid.Column="0"+ Margin="12,0,0,0"+ Spacing="4"+ VerticalAlignment="Center">+ <TextBlock+ Name="FileNameHeader"+ Text="{x:Bind File.Name}"+ TextWrapping="Wrap" />+ <TextBlock+ Text="{x:Bind FileSize, Mode=OneWay}"+ Opacity="0.75"/>+ </StackPanel>+ <StackPanel+ Grid.Column="1"+ Margin="12,0,0,0"+ Spacing="4"+ VerticalAlignment="Center">+ </StackPanel>+ <StackPanel+ Grid.Column="2"+ Margin="12,0,0,0"+ VerticalAlignment="Center"+ Orientation="Horizontal"+ AutomationProperties.LabeledBy="{Binding ElementName=FileNameHeader}">+ <Button+ Style="{StaticResource CommandBarFlyoutEllipsisButtonStyle}"+ Command="{x:Bind SaveCommand}"+ CommandParameter="{Binding ViewModel, ElementName=ThisPage}"+ ToolTipService.ToolTip="{x:Bind Strings.SaveAs}"+ AutomationProperties.Name="{x:Bind Strings.SaveAs}">+ <FontIcon+ FontFamily="{StaticResource FluentSystemIcons}"+ Glyph=""/>+ </Button>+ <Button+ Style="{StaticResource CommandBarFlyoutEllipsisButtonStyle}"+ Command="{x:Bind DeleteCommand}"+ ToolTipService.ToolTip="{x:Bind Strings.Delete}"+ AutomationProperties.Name="{x:Bind Strings.Delete}">+ <FontIcon+ FontFamily="{StaticResource FluentSystemIcons}"+ Glyph=""/>+ </Button>+ </StackPanel>+ </Grid>+ </Grid>+ </DataTemplate>+ </ItemsControl.ItemTemplate>+ </ItemsControl>+ </StackPanel>+</Page>diff --git a/src/dev/impl/DevToys/Views/Tools/Graphic/ImageConverter/ImageConverterToolPage.xaml.cs b/src/dev/impl/DevToys/Views/Tools/Graphic/ImageConverter/ImageConverterToolPage.xaml.csnew file mode 100644index 000000000..21274abec--- /dev/null+++ b/src/dev/impl/DevToys/Views/Tools/Graphic/ImageConverter/ImageConverterToolPage.xaml.cs@@ -0,0 +1,50 @@+#nullable enable++using DevToys.Api.Core.Navigation;+using DevToys.Shared.Core;+using DevToys.ViewModels.Tools.ImageConverter;+using Windows.UI.Xaml;+using Windows.UI.Xaml.Controls;+using Windows.UI.Xaml.Navigation;++namespace DevToys.Views.Tools.ImageConverter+{+ public sealed partial class ImageConverterToolPage : Page+ {+ public static readonly DependencyProperty ViewModelProperty+ = DependencyProperty.Register(+ nameof(ViewModel),+ typeof(ImageConverterToolViewModel),+ typeof(ImageConverterToolPage),+ new PropertyMetadata(null));++ /// <summary>+ /// Gets the page's view model.+ /// </summary>+ public ImageConverterToolViewModel ViewModel+ {+ get => (ImageConverterToolViewModel)GetValue(ViewModelProperty);+ set => SetValue(ViewModelProperty, value);+ }++ public ImageConverterToolPage()+ {+ InitializeComponent();+ }++ protected override void OnNavigatedTo(NavigationEventArgs e)+ {+ if (ViewModel is null)+ {+ var parameters = (NavigationParameter)e.Parameter;++ // Set the view model+ Assumes.NotNull(parameters.ViewModel, nameof(parameters.ViewModel));+ ViewModel = (ImageConverterToolViewModel)parameters.ViewModel!;+ DataContext = ViewModel;+ }++ base.OnNavigatedTo(e);+ }+ }+}