LocalFields |
LocalFields are value containers that can be accessed through element context boundaries and are able to invoke actions when value changes.
Unlike Fields they are not accesible in global context and not accessible by the children or grand-children without explicitly defining Scope attribute or parameter. For SetFields to access LocalFields, they need to use Scope attribute showing which Element owns the LocalField. For Bindings with FieldValue or FieldTranslatedValue they need to specify Scope parameter.
LocalFields has higher priority of getting and setting value than Fields.
< Element Id="Incubator1"> <Fields> <LocalField Id="Incubator_IsOpen" Value="False" Type="bool"> <ChangedHandler> <CompositeAction> ... </CompositeAction> </ChangedHandler> </LocalField> </Fields> <StateGroups> <StateGroup> <State Id="State_Open_Incubator"> <Triggers> <Trigger> <Conditions> <DataCondition Target="{FieldValue Incubator_IsOpen, Scope={Binding ElementId=Incubator}}" Value="False" /> </Conditions> <Actions> <SetField Id="SetField_Open_Incubator" FieldId="Incubator_IsOpen" Value="True" Scope="{Binding ElementId=Incubator1}" /> </Actions> </Trigger> </Triggers> </State> </StateGroup> </StateGroups> </Element>
LocalField value can be obtained using FieldValue markup extension.
If Scope is not specified the target will be closest scopable parent element.
< Button IsVisible="{FieldValue Incubator_IsOpen}" />
Value can be set with SetField action.
If Scope is not specified the target will be closest scopable parent element.
< SetField FieldId="Incubator_IsOpen" Value="True" />