Creating a style for a label.

The BoldLabelStyle demostrates how to set the Font and Background of a label based on properties found in the GUI and Field object definitions.

&lt;!-- As the only property I want to change is the Font and Background, I based the style on the Default supplied with SB/XA. This way I get all the standard characteristics as well as any changes that are made to the product in future releases. --&gt; &lt;Style x:Key="BoldLabelStyle" BasedOn="{StaticResource DefaultSBLabelStyle}"&gt; &lt;Style.Triggers&gt; &lt;!-- This trigger will check to see if the FieldDefinition has been set, by using the SBIsNullConverter to check if it is null or not. Then checks to see that it is not a data field, i.e. a display field by checking that the GuiObjectDefinition.FieldDefinition.IsDataField property is False. In both these two conditions, the source for the GuiObjectDefinition is found by going up the VisualTree to find the first control that is an instance of SBLabel. --&gt; &lt;MultiDataTrigger&gt; &lt;MultiDataTrigger.Conditions&gt; &lt;Condition Binding="{Binding Path=GuiObjectDefinition.FieldDefinition,                                                   RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type sbc:SBLabel}},                                                    Mode=OneWay,                                                    Converter={StaticResource SBIsNullConverter}}" Value="False"/&gt; &lt;Condition Binding="{Binding Path=GuiObjectDefinition.FieldDefinition.IsDataField,                                                   RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type sbc:SBLabel}}}" Value="False"/&gt; &lt;/MultiDataTrigger.Conditions&gt; &lt;!-- both the conditions are true, so go ahead and set the FontWeight to Bold --&gt; &lt;Setter Property="Control.FontWeight" Value="Bold"/&gt; &lt;/MultiDataTrigger&gt; &lt;!-- This trigger will check to see if the FieldDefinition has been set, by using the SBIsNullConverter to check if it is null or not. Then checks to see that it is a data field, i.e. a display field by checking that the GuiObjectDefinition.FieldDefinition.IsDataField property is True. In both these two conditions, the source for the GuiObjectDefinition is found by going up the VisualTree to find the first control that is an instance of SBLabel. --&gt; &lt;MultiDataTrigger&gt; &lt;MultiDataTrigger.Conditions&gt; &lt;Condition Binding="{Binding Path=GuiObjectDefinition.FieldDefinition,                                                   RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type sbc:SBLabel}},                                                    Mode=OneWay,                                                    Converter={StaticResource SBIsNullConverter}}" Value="False"/&gt; &lt;Condition Binding="{Binding Path=GuiObjectDefinition.FieldDefinition.IsDataField,                                                   RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type sbc:SBLabel}}}" Value="True"/&gt; &lt;/MultiDataTrigger.Conditions&gt; &lt;!-- Both conditions have been met, so go ahead and set the Background of the control to White. --&gt; &lt;Setter Property="Control.Background" Value="White"/&gt; &lt;/MultiDataTrigger&gt; &lt;!-- the following trigger checks to see if the FieldDefinition is null, if it is the FontWeight of the Label is set to Bold. --&gt; &lt;DataTrigger Binding="{Binding Path=GuiObjectDefinition.FieldDefinition,                                             RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type sbc:SBLabel}},                                              Mode=OneWay,                                              Converter={StaticResource SBIsNullConverter}}" Value="True"&gt; &lt;Setter Property="Control.FontWeight" Value="Bold"/&gt; &lt;/DataTrigger&gt; &lt;/Style.Triggers&gt; &lt;/Style&gt;