In our old app we used to have an mdi parent that would open a root object form. From that form you could open a child form and because they were both mdi children you couldn't go modal on the child form. To ensure that the root object form wasn't closed while a child form was open we would simply apply a broke rule to the root like this; mobject.m_valid.RuleBroken("Child form needs to be closed!", True). Once the form was closed we would remove the rule.
This seemed to work great but with the new release of CSLA it seems all rules are associated to a property of the object. How do people handle the opening of a child form and not allow the parent to be closed or is there a way to do what we used to do - add a broken rule when the child form is opened.
On a side note, I have searched for details on VB subclassing of the baseobjects and most examples are in C#. Is there a link to examples or detailed discussions anywhere about VB subclassing.
Thanks
Tom
Thanks for your reply ajj3085.
We handled it this way because a parent object that has say 3 different child collections could very well have 3 different child forms open. Adding a rule for each then gave the user a visual description of why the parent can't be closed, specifically the names of all of the open child forms. Our users in many cases have muliple child forms open at the same today.
I suppose this issue is win form specfic as you couldn't do this in a web UI.
"VB subclassing of the baseobjects "
I know I posted some VB samples for BusinessBase and BusinessListBase.
<Serializable()> _
Public MustInherit Class MyBusinessBase(Of T As MyBusinessBase(Of T))
Inherits BusinessBase(Of T)
<Serializable()> _
Public MustInherit Class MyBusinessListBase(Of T As MyBusinessListBase(Of T, C), C As IBusinessObject)
Inherits BusinessListBase(Of T, C)
Note: C As IBusinessObject can be changed to whatever you need it to be - some other Interface or ...
Joe
Copyright (c) Marimer LLC