Example #1
0
        /// <inheritdoc />
        public async Task LoadImagesAsync()
        {
            var openDialogOptions = new OpenDialogOptions
            {
                Title      = Translator.Translate("Please choose your Images"),
                Properties = new[] { OpenDialogProperty.openFile, OpenDialogProperty.multiSelections },
                Filters    = new[]
                {
                    new FileFilter
                    {
                        Extensions = new[] { "jpg", "png", "gif" }, Name = Translator.Translate("Images")
                    }
                }
            };
            var imageFilePaths = await ElectronHelper.ShowOpenDialogAsync(ElectronHelper.GetBrowserWindow(), openDialogOptions);

            if (imageFilePaths != null && imageFilePaths.Any())
            {
                await CurrentProject.AddImagesAsync(imageFilePaths);
            }
        }