Setting Values Based Upon Input

Setting Values Based Upon Input

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


thaehn posted on Wednesday, April 22, 2009

Hi,

I have a question regarding the perferred way of changing a value based upon some user input.  Here is the senario:

When the user unchecks an "Active" checkbox, the completed date is fed in automatically into the data entry form.  I doubt it should be done in the UI.  So I was thinking that it should be done in the  setter method of the ActiveProperty like this:

private static PropertyInfo<bool> ActiveProperty = RegisterProperty(new PropertyInfo<bool>("Active"));

public bool Active

{

get { return GetProperty<bool>(ActiveProperty); }

set { SetProperty<bool>(ActiveProperty, value);

        if (ReadProperty(ActiveProperty) = false) {

            LoadPropertyConvert<SmartDate, System.DateTime>EndedProperty, DateTime.Today); }}

But that isn't allowed.  Where is the proper place to put this code?

Todd

P.S.  How do I get rid of double-spacing in the source code?

 

ajj3085 replied on Wednesday, April 22, 2009

create a business rule tied to Active; the rule can do anything it wants, not just validation.

Copyright (c) Marimer LLC