Beispiel #1
0
        /// <summary>
        /// Lets the user select the file path of
        /// the csv file.
        /// </summary>
        public void SelectFilePath()
        {
            IFileDialog sfd = _windowManager.CreateSaveFileDialog();

            sfd.Filter = "CSV Files (*.csv) | *.csv";
            if (sfd.ShowDialog())
            {
                FilePath = sfd.FileName;
            }
        }
Beispiel #2
0
 /// <summary>
 /// Shows a dialog to save the <see cref="Collage"/> to file.
 /// </summary>
 public void SaveImage()
 {
     try
     {
         IFileDialog sfd = _windowManager.CreateSaveFileDialog();
         sfd.Filter = "Bitmap Image (.bmp) | *.bmp";
         if (sfd.ShowDialog())
         {
             using (var fileStream = new FileStream(sfd.FileName, FileMode.Create))
             {
                 BitmapEncoder encoder = new PngBitmapEncoder();
                 encoder.Frames.Add(BitmapFrame.Create(Collage));
                 encoder.Save(fileStream);
             }
         }
     }
     catch (Exception ex)
     {
         OnStatusUpdated($"Fatal error while saving collage to file: {ex.Message}");
     }
 }