/// <summary> /// Open file using open dialog. /// </summary> public void OpeFile() { OpenFileDialog dialog = new OpenFileDialog(); dialog.Filter = "Binary file (.bin)|*.bin"; bool?result = dialog.ShowDialog(); if (result == true) { string filename = dialog.FileName; try { _folder = _serializeClient.DeserializeFolderModel(filename); var treeItem = Mapper.Map <TreeViewItemModel>(_folder); Filename = filename; TreeViewItemModels.Clear(); TreeViewItemModels.Add(treeItem); } catch (Exception ex) { _logger.Error(ex); } } }