private void Save_Click(object sender, EventArgs e) { if (FileListVM.Files.Count > 0) { if (saveFileDialog.ShowDialog() == true) { imagePacker.Reset(); imagePacker.SetSize(Int32.Parse(Sizes.SelectedItem.ToString())); imagePacker.SetPadding(currentPaddingText != null ? Int32.Parse(currentPaddingText) : 0); FileListVM.Files.ToList().ForEach(x => { imagePacker.AddImagePath(x.FilePath); }); imagePacker.SaveFile(saveFileDialog.FileName); } } }