Style.Enabled

Syntax

Enabled: Boolean

Description

The Enabled property determines whether the style can be applied to component.

Comments

Use JSON or the setEnabled method to set the property value, and the getEnabled method to get the property value.

This property contains True if the style can be applied to the component, and False if otherwise.

Example

To execute the example, the HTML page must contain links to the jquery.js, PP.js scenario files, and the PP.css styles file. Add a text area to document, and set a new style for this area, but prohibit applying this style:

// Create a text area
var textArea = new PP.Ui.TextArea({
    Width: 200,
    Height: 100,
    Content: "2013" // Contents
});
// Create a style for text area
var style = {
    Release: new PP.Style({
        // Create a solid fill brush
        Background: new PP.SolidColorBrush({
            Color: PP.Color.Colors.lightblue
        }),
        Enabled: False // Prohibit style use
    })
};
// Set style
textArea.setStyle(style);
// Add this area to document
textArea.addToNode(document.body);

After executing the example a text area is created in the document, a style that color this area in light blue color is set, but not applied:

See also:

Style