AE in ComboBox convention

Issue #31 new
Former user created an issue

Access violation occurs in VCL Convention for TComboBox in case when bound property is the member of ViewModel direct property. AViewModel.GetProperty(APropertyName) returns nil and further checking of the PropertyType crashes.

The same bug can occur in VCL Convention for TPanel and FMX Convention for TLayout.

Comments (2)

  1. Former user Account Deleted

    The crazy thing is that ViewModelBinder.BindProperties finds well true nested property but never uses it for binding. So the nested property should be found again just to check for the type, and then it is not needed for binding again. The search function for properties should be abstracted, so it could be reused. To prevent modification of other code (it is not my framework), I put the new pure function TryGetNestedProperty in DSharp.Core.Reflection. It uses GetPropertyCaseInsensitive, which I also moved to this unit, it is not used anywhere else. Then I adapted the code in ViewModelBinder.BindProperties and VCLConventionManager for TComboBox. Please adapt the patch as you wisch with respect to the logic of the whole framework, I'm using it for 2 weeks and do not have the big picture yet.

  2. Log in to comment