CslaLight PropertyStatus - setting ReadOnly

CslaLight PropertyStatus - setting ReadOnly

Old forum URL: forums.lhotka.net/forums/t/7300.aspx


cds posted on Saturday, July 18, 2009

Hi all...

I notice in the PropertyStatus class for CslaLight that when a property can't be written is does the following:

MethodCaller.CallMethodIfImplemented(_target, "set_IsReadOnly", true);
MethodCaller.CallMethodIfImplemented(_target, "set_IsEnabled", false);


The result of this is that when it comes to a property bound to a TextBox, both the IsReadOnly and IsEnabled properties get changed. It would be really nice if it only set the IsEnabled to false as a fallback if the IsReadOnly property couldn't be set.

I don't see this as hard to achieve, but if I do, I need to modify the CSLA source for my project, or totally copy the PropertyStatus class and re-implement it (the HandleTarget method where this exists isn't virtual, otherwise I'd just subclass it.)

Comments?

RockfordLhotka replied on Sunday, July 19, 2009

That is a bug, thank you for calling it to my attention. I'll add it to the bug list.

Copyright (c) Marimer LLC