Skip to content
This repository was archived by the owner on Jun 5, 2020. It is now read-only.

"Data binding" for rules #945

@rockfordlhotka

Description

@rockfordlhotka

I had an idea. Might be good, might be bad, I thought I'd float it out here and see what people think.

The idea is that writing a rule today usually means creating a constructor and adding items to the input properties collection. Which is ok, but not declarative. Also, there's not a good way to reference values from other parts of the object graph - ancestors, siblings, or children of the target object.

I don't have this clearly in my head - but it occurred to me that XAML data binding has mechanisms for binding to ancestors at least. Maybe there's some way to make life better?

  public class MyRule : BusinessRule
  {
    [BindTarget(OrderItem.NameProperty)]
    public string Name { get; set; }
    [BindAncestor(Order.TaxCodeProperty)]
    public string TaxCode { get; set; }
  }

This is pretty vague - what do you think though?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions