private void CaptureCanvasBtn_Clicked(object sender, RoutedEventArgs e) { var png = DrawCanvas.ToBitmap().ToPng(); var saveFileDialog = new SaveFileDialog(); saveFileDialog.FileName = DateTime.Now.ToString("yyyy_MM_dd_HHmmss"); saveFileDialog.Filter = "Png File (*.png) | *.png"; if (saveFileDialog.ShowDialog() == true) { using (Stream fileStream = File.Create(saveFileDialog.FileName)) { png.Save(fileStream); } } }