private void Exporter_Click(object sender, RoutedEventArgs e) { if (this.dataMesh == null) { MessageBox.Show("Valid Mesh not found!"); return; } Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog(); dlg.Title = "Save the Scene to Wavefront Obj format"; dlg.DefaultExt = ".obj"; dlg.Filter = "PNG documents (.obj)|*.obj"; dlg.FileName = string.Format("Type '{0}' -- Name '{1}' (Vertical scaling factor {2})", this._selectedData.SelectedSpatialData.Type.ToString(), this._selectedData.SelectedSpatialData.Name, this.scaledZ.Text); Nullable <bool> result = dlg.ShowDialog(this); string fileAddress = ""; if (result == true) { fileAddress = dlg.FileName; } else { return; } SpatialDataToMesh.SaveToWavefrontObj(this.dataMeshModel, fileAddress); }