Hy,
I want to implement in my application (WPF user interface) copy and paste from/to separated views where Items view are business object (or better ui element with BO behind).
My business layer is based on CSLA that has a specific factory object as root of each different chain where business object are child elements (child XXXBOList with child XXXBO object with a classic tree structure). When a specific BO has some other child BO objects (through child BOList) it demand to factory to load and get those child BO objects, passing ID as parameter.
So, when user select items from a listview (for example) and clicks copy (command) my code extracts child BOs from a BOList, it clones (Clone() method) them, and it copy them into an ArrayList before load this list on Clipboard with Clipboard.SetaData() method.
Next, the user moves to another view and clicks paste. My code extracts BO items from Clipboard.GetData() method and then tries to rebuild new BOs with the same property values of source BOs.
All work fine except when source BO contains lazyload properties that require a factory call to get those child object. In this case factory root object is no longer "Parent" of those pasted objects and so factory parent object is null and I cannot rebuild those objects.
I hope I was clear to explain my issue. How cai I resolve it?
Best regards