All generated controls have common properties which can be customized

Control common properties
Control common properties
  1. Control icon selected from the standard library of icons
  2. Custom control icon loaded from the image
  3. Tooltip of the control displayed on mouse hovering

Style

Common styles can be customized via ControlOptionsAttribute by decorating the specific properties in data model.

This attribute allows to define the alignment, position, size as well as background and foreground colours:

public class DataModel
{
    [ControlOptions(backgroundColor: KnownColor.Green, textColor: KnownColor.Yellow)]
    public string Text { get; set; }
}
Custom background and foreground colours applied to textbox
Custom background and foreground colours applied to textbox

Attribution

Tooltip

Tooltip for controls can be set by applying the DescriptionAttribute

Standard Icon

Standard icon added to text box control
Standard icon added to text box control

Standard icon defined in swControlBitmapLabelType_e enumeration can be set to control via ControlAttributionAttribute attribute.

 public class DataModel
 {
    [Description("Depth Value")]
    [ControlAttribution(swControlBitmapLabelType_e.swBitmapLabel_Depth)]
    public string Depth { get; set; }
}

Custom Icon

Custom icon can be set via overloaded constructor of ControlAttributionAttribute attribute

 public class DataModel
 {
    [ControlAttribution(typeof(Resources), nameof(Resources.OffsetImage))]
    public double Offset { get; set; }
}

Second version of the overloaded constructor allows to specify the transparency mask through shades of grey with boundaries of black pixels = 100% opaque and white pixels = 100% transparent. If first version of constructor is used mask will be generated automatically based on the transparency (Alpha channel of the image).