private void Export(object sender, RoutedEventArgs e) { var m = Model as IfcStore; if (m == null) { return; } var newName = Path.ChangeExtension(m.FileName, ".report.xlsx"); var ret = ValFacility.ExportFacility(new FileInfo(newName)); MessageBox.Show(ret); }