Breaking Change T831750
Visible to All Users

The PropertyManager class has been removed

What Changed

In v20.1, we removed the PropertyManager class. The PropertyBag object is moved to BindableBase and is only instantiated when methods that store a property value by its name are used. If you store your property values in fields, no excessive objects will be created.

Reasons for Change

Prior to v20.1, instantiation of a single BindableBase object meant instantiation of 3 reference objects on the heap - BindableBase, PropertyManager, and the propertyBag object inside PropertyManager. This significantly increased memory usage when a lot (hundreds of thousands) of BindableBase objects were instantiated. Due to excessive memory allocation, collection of garbage also took significant time when objects were created.

Impact on Existing Apps

In versions prior to 18.2, we suggested the use of the PropertyManager.GetProperty and PropertyManager.SetProperty methods to create custom methods with the CallerMemberNameAttribute attribute.

C#
public abstract class BindableBaseEx : BindableBase { PropertyManager propertyManager = new PropertyManager(); protected bool SetProperty<T>(T value, [CallerMemberName] string propertyName = null) { return propertyManager.SetProperty(propertyName, value, () => RaisePropertyChanged(propertyName)); } protected T GetProperty<T>([CallerMemberName] string propertyName = null) { return propertyManager.GetProperty<T>(propertyName); } } public class ViewModel : BindableBaseEx { public string FirstName { get { return GetProperty<string>(); } set { SetProperty(value); } } }

These methods will no longer be compiled.

How to Update Existing Apps

In case you still use this class, replace these custom methods with the built-in GetValue and SetValue methods available in versions 18.2 and newer.

C#
public class ViewModel : BindableBase { public string FirstName { get { return GetValue<string>(); } set { SetValue(value); } } }

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.