We're using WPF, and seem to have found a problem with the CSLA validation panel causing an infinite loop. Here's the scenario:
We have a details view where at run-time we build a list of text boxes representing properties of a business object selected from a list in separate "sidebar" view. The run-time code binds the text boxes to the selected BO's properties. We keep the underlying details view reference around for the remaining scope of our application. As the user clicks different BO's in the sidebar, we rebind the details view. The BO's are not all of the same type, so we rebind by removing the text boxes and recreating a new set of them.
In the details view we use CSLA's validation panel to
wrap around the dynamically added bound text boxes. We added the Validation panel beforehand in
XAML, and the run-time code adds the text boxes to it.
if (_bindings.Count == 0)
ReloadBindings();
We are back up to ReloadBindings, and the program loops.
We were able to stop this behavior by putting a check in
ReloadBindings to not call Refresh unless _bindings.Count is greater than zero.
Copyright (c) Marimer LLC