Prevent changing Property

Prevent changing Property

Old forum URL:

t.kehl posted on Sunday, March 06, 2011


I have an EditableBusinessObject. There is a Property Name, which I want to prevent for changing, when the Property IsActive is set to false. It should be thrown an Exception, when Name will be written when IsActive is set to false and I need also a binding for a TextBox in my WPF-View.

Now, I am searching the best way to do that. Should I use CanWriteProperty for that? What is the best solution for this?

Thank you.

Best Regards, Thomas

ajj3085 replied on Sunday, March 06, 2011

CanWriteProperty is the only solution prior to Csla4.  In version 4, I believe you should be able to make your own authorization rule to handle this as well.  Auth rules can do anything, they aren't limited to checking IsInRole.

Copyright (c) Marimer LLC