(a) If any person is entitled to an estate for life or years or to an estate tail, fee simple, conditional, base or qualified fee, or any other particular, limited, or conditional estate in property, and any other person is entitled to a vested or contingent remainder, executory devise, or any other vested or contingent interest in the same property, on application of any of the parties in interest and if all parties in being are parties to the proceeding, a court of equity may decree a sale, lease, or mortgage if it appears to be advantageous to the parties concerned. The court shall direct the investment of the proceeds of the sale, mortgage, or limitations of the reversion and rent as the case may be, so these inure to the use of the same parties who would be entitled to it if the property is sold, leased, or mortgaged.
(b) If every person who would be entitled to the property if the contingency happened at the date of the decree is a party, the decree binds every person whether he is in being or not, who claims or may claim any interest in the property under any party to the decree, under any person from whom any party to the decree claims, or under the original deed or will by which the particular, limited, or conditional estate, with remainders or executory devises, is created. Any mortgage executed pursuant to the decree binds the property so mortgaged of every person, whether in being or not.