TryGetCustomProperty(String, out String) Method

Definition

Namespace Svg
Assembly Svg.Custom.dll

Attempts to get the value of a CSS custom property (CSS variable) defined on this element. Unlike TryGetAttribute(String, out String), this checks every specificity level in the style dictionary and returns the value with the highest specificity, making it suitable for resolving custom properties sourced from external stylesheets as well as inline styles.

public bool TryGetCustomProperty(string name, scoped out string value)

Parameters

name
String

The custom property name, including the leading '--'.

value
String

The resolved value if found; otherwise null.

Returns

Boolean
true if the custom property was found on this element; otherwise false.