Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This chapter goes into detail on the actual hooks in the metadata that accept expressions as input.

Values

When a property is assigned a value generator, it is considered to be a calculated propertyMetadata Calculated Properties. The methods for creating calculated properties build on the SetValueExpression() family of methods.

...

Code Block
propertyBuilder.ValueExpression("UtcNow")

Default values

Any property can have a default value. Where possible, this value is mapped as the default value in the database. It is also used to initialize objects in memory.

...

Code Block
propertyBuilder.DefaultValueExpression("UtcToday")

UI features

There are convenience methods for many common visual settings.

...

For all of these methods, note that the "last call wins": any existing expression is replaced by the new call.

Visible

Set a constant visibility.

...

Code Block
propertyBuilder.IsVisible("Salary > 10000")

Enabled

Set a constant enabled.

Code Block
property.IsEnabled(false)

...

Code Block
property.IsEnabled("Salary > 10000")

Read-only

Set a constant read-only.

...

Code Block
property.IsReadOnly("Salary > 10000")

Instruction text

Set a constant read-only.

...