public bool DeleteLoadout(LoadoutViewModel loadout) { return(ReorganizableCollectionUtilities <LoadoutViewModel> .Remove( Loadouts, loadout, x => SelectedLoadout == x, () => SelectedLoadout = null )); }
public bool MoveLoadoutDown(LoadoutViewModel loadout) { return(ReorganizableCollectionUtilities <LoadoutViewModel> .MoveDown( Loadouts, loadout, () => SelectedLoadout, x => SelectedLoadout = x )); }
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); }