private void CreateStorage() { var saveFileDialog = new SaveFileDialog { Filter = "Data file|*.dat" }; var result = saveFileDialog.ShowDialog(); if (result != true) { return; } try { _storage = _storageFactory.CreateFileStorageViewModel <StudentModel>(saveFileDialog.FileName); UpdateState(); } catch (Exception ex) { MessageBox.Show("Something went wrong."); } }