views:

8

answers:

0

Hi, We are building a Silverlight based LOB application. Per the business requirements the fields which will be bound to Silverlight screens has dependency in the form of rules. The below example can be more helpful to understand. public class Model { //properties public int A { get; set; } public int B { get; set; } public int C { get; set; } }

//different assembly
public class Rules
{
    private Model model;
    public Rules(Model model)
    {
        this.model = model;
    }

    public void Rule1()
    {
        // some logic
    }


    public void Rule2()
    {
        if (model.A > 100)
        {
            this.model.B = 100;
        }
        else
        {
            this.model = 50;
        }
    }

}

In the above code, in Rule2 has dependency on property A. So per the business team, I need to run Rule2 as soon as Property A is changed.

I want to what is the approach I should use to find the dependency so that I can invoke this rule2() using reflection.

Any other approach also helpful. Please help.