// weaponDesignVM._pieceLists[pieceType] would be cleaner but it's private private CraftPartVM GetCraftPartVM(WeaponDesignVM weaponDesignVM, CraftingPiece.PieceTypes pieceType, string pieceId) { MBBindingList <CraftPartVM> partList = null; switch (pieceType) { case CraftingPiece.PieceTypes.Blade: partList = weaponDesignVM.BladePartList; break; case CraftingPiece.PieceTypes.Guard: partList = weaponDesignVM.GuardPartList; break; case CraftingPiece.PieceTypes.Handle: partList = weaponDesignVM.HandlePartList; break; case CraftingPiece.PieceTypes.Pommel: partList = weaponDesignVM.PommelPartList; break; case CraftingPiece.PieceTypes.Invalid: case CraftingPiece.PieceTypes.NumberOfPieceTypes: break; } return(partList.First(p => p.CraftingPiece.CraftingPiece.StringId == pieceId)); }