public bool RenameLoadout(LoadoutViewModel loadoutViewModel) { var inputOptions = new InputOptions { WindowTitle = $"Rename skill loadout", WindowPrompt = $"Rename skill loadout '{loadoutViewModel.Name}'", WindowDefaultValue = loadoutViewModel.Name, IsInputMandatory = true, IsValid = x => Loadouts.Where(l => l != loadoutViewModel).All(l => l.Name != x) }; if (InputUtils.Show(inputOptions, out string newName)) { loadoutViewModel.Name = newName; return(true); } return(false); }
public bool RenameLoadout(LoadoutViewModel loadoutViewModel) { var renameOptions = new RenameOptions { WindowTitle = $"Rename skill loadout", WindowPrompt = $"Rename skill loadout '{loadoutViewModel.Name}'", WindowDefaultValue = loadoutViewModel.Name, IsInputMandatory = true, IsValid = x => Loadouts.Where(l => l != loadoutViewModel).All(l => l.Name != x) }; if (ServicesContainer.GetService <IRenameService>().Rename(renameOptions, out string newName)) { loadoutViewModel.Name = newName; return(true); } return(false); }