Version

StyleResourceName Property (LinkedAppearance)

Returns or sets the name of the application styling resource whose appearance information should be included when the MergeData method is invoked.
Syntax
'Declaration
 
Public Overrides Property StyleResourceName As String
public override string StyleResourceName {get; set;}
Remarks

The StyleResourceName is used to indicate the name of the resource whose style information should be included when the MergeData method is used to obtain the appearance information. The StyleLibraryName indicates the name under which the application style library that will be used to obtain the resource has been loaded. To obtain a resource from the default/main style library, the StyleLibraryName can be left set to null (Nothing in VB), which is the default value, or empty string. Therefore, by default, the resource identified by the StyleResourceName will be retrieved from the default style library.

The properties set on the Appearance itself (e.g. BackColor, etc.) will take precedence over the values set in the associated application style resource. So when the MergeData is invoked, the information from the appearance properties are merged in first and any remaining properties to be resolved will be picked up from the associated resource.

Note: The HasPropertyBeenSet and HavePropertiesBeenSet will return true for properties that will be provided by the associated application style resource. However, the properties of the appearance (e.g. BackColor, etc.) will not return the values from the associated application style resource. To obtain the property values, whether they be set on the properties or set in the associated application style resource, you must use the MergeData method.

Since the Appearance has no reference to the control(s) that may be using it, the controls may need to be explicitly invalidated (e.g. using Control.Invalidate) in order to see the style information provided by the resource if an application style library is loaded after the control has rendered. Likewise, for cases where the appearance information was used to calculate metrics, the control's metrics may need to be dirtied when the application style library from which the resource is obtained has been changed. In cases where the control/component using the appearance is using application style information from the same application style library, you will likely not need to do anything as the control should invalidate its display/metrics when the Infragistics.Win.AppStyling.StyleManager.StyleChanged event is invoked in that case.

Since the Appearance has no reference to the control(s) that may be using it, it is not possible to honor the Infragistics.Win.AppStyling.ComponentRole.ResolutionOrder. Therefore, when the Infragistics.Win.AppStyling.ResolutionOrder is set to ControlOnly, the style information from the resource will still be used when the appearance information is obtained. Likewise, when it is set to ApplicationThenControl, the property values from the appearance will still be merged in before those of the appearance. Lastly, if the ResolutionOrder is set to ApplicationOnly, the MergeData methood of the appearance will not be invoked and therefore the resource information will not be used.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also