public void OnClick(Window mainWindow, Instance instance) { var path = ExpandPath(instance).Replace("/", "\\"); if (!FileSystem.FileSystem.Local.Directory.Exists(path)) { var answer = WindowHelper.ShowMessage("The folder does not exist. Would you create it?\n\n" + path, MessageBoxButton.OKCancel, MessageBoxImage.Asterisk); if (answer != MessageBoxResult.OK) { return; } FileSystem.FileSystem.Local.Directory.CreateDirectory(path); } MainWindowHelper.OpenFolder(path); }