Skip to main content

WebARIA

Namespace: Wisej.Web.Ext.WebARIA

Assembly: Wisej.Web.Ext.WebARIA (4.1.0.0)

Extender component that adds the ARIA (WAI-ARIA) property to all controls in the same container, allowing the application to assign aria-* attributes to the accessibility element of each control.

public class WebARIA : Component, IExtenderProvider

Drop the component on a container (i.e. a Form or Page) and use the "Aria" property added to each control in the designer, or call GetAria in code. The attributes are applied on the client to the control's accessibility element. Controls that are not created yet (i.e. not visible) are registered when they are created.

Constructors​

Instance member WebARIA()​

Initializes a new instance of the WebARIA extender without a specified container.

Instance member WebARIA(container)​

Initializes a new instance of the WebARIA extender with a specified container.

NameTypeDescription
containerIContainerAn IContainer that represents the container of the WebARIA extender.

Throws:

Methods​

Instance member CanExtend(target)​

Returns true if WebARIA can offer an extender property to the specified target component.

ParameterTypeDescription
targetObjectThe target object to add an extender property to.

Returns: Boolean. true if target is a Control; otherwise, false.

This method is used by the designer to determine which components receive the "Aria" property.

Example:

Checking whether a component can receive ARIA attributes:

if (this.webARIA1.CanExtend(this.textBox1))
{
this.webARIA1.GetAria(this.textBox1).Label = "Customer name";
}

Instance member Clear()​

Removes the ARIA properties from all the controls managed by this extender.

The aria-* attributes previously assigned on the client are removed.

Example:

Removing all the ARIA attributes:

private void buttonReset_Click(object sender, EventArgs e)
{
this.webARIA1.Clear();
}

Protected member Dispose(disposing)​

ParameterTypeDescription
disposingBoolean

Instance member GetAria(control)​

Returns the ARIA properties for the specified Control.

ParameterTypeDescription
controlControlControl for which to return the ARIA properties.

Returns: ARIA. The ARIA instance associated with control . It's created the first time it's requested.

The returned object is kept by the extender until the control is disposed or Clear is called. The attributes are sent to the client when the extender is rendered. Changing the ARIA properties invalidates the owner control; call Update() on the extender to refresh the attributes of controls that are already displayed.

Throws:

Example:

Assigning ARIA attributes to a text box and a numeric field:

private void Form1_Load(object sender, EventArgs e)
{
var aria = this.webARIA1.GetAria(this.textBoxEmail);
aria.Label = "Email address";
aria.Required = TriState.True;
aria.DescribedBy = this.labelEmailHint;

var quantity = this.webARIA1.GetAria(this.numericUpDownQuantity);
quantity.ValueMin = 1;
quantity.ValueMax = 100;
quantity.ValueNow = 10;

this.webARIA1.Update();
}

Protected member OnWebRender(config)​

Renders the client component.

ParameterTypeDescription
configObjectDynamic configuration object.

Implements​