Property group methods

Declare [PropertyGroup<TGroup>] on the model. The marker must implement IPropertyGroup.

Method Purpose
logic.PropertyGroup<TGroup>() Get the declared group.
group.Add(e => e.Name) Add members. Use new { e.Name, e.Note } for several.
group.ReadOnly().If(e => e.IsPosted) Make members with setters read-only.
group.Hidden().If(e => !e.IsPosted) Hide members. The condition must work in SQL; identity fields cannot be hidden.
group.Changed().Do((e, args) => ...) Handle property changes and LoadAll collection changes.
args.CollectionChangedArgs Get the action and changed items. Null for property value changes.
args.CopyTo(target) Copy one property change. Throws for collection events.
compute.From(...).DirtyByGroup<TGroup>() Recalculate when a member changes. LoadAll collections are supported.
group.GetPropertyStates(record) Read member states by name. Filter with IsModified.
group.Copy(source, target) Copy group values, skipping collections.
group.Describe() Show members, rules, and registration sources.

Register during startup; groups lock afterward. Rules also apply to members added later. Duplicates do nothing. Each rule keeps its original feature. Any true read-only or hidden condition applies. Pass skipReadOnly: true to either copy method to skip read-only and hidden targets. See the guide for examples and copying rules.