- Microsoft Silverlight, versions 3 and greater
- Silverlight managed programming model and Silverlight XAML
Microsoft has stopped updating and distributing Silverlight, and authors are encouraged to use HTML for accessible web content.
This technique relates to Success Criterion 3.1.2: Language of Parts (Sufficient).
The objective of this technique is use the HTML
Lang attribute on
the object tag to describe each Silverlight plug-in instance on the
HTML hosting page as a "part" that has a different language.
Assistive technologies that use HTML Lang as a determinant of language
of parts can thus treat all Silverlight content as using that HTML
Most assistive technologies that are capable of determining Language for Web content will use the HTML Lang tag value as the determinant of the language of the page. Assistive technologies would also use HTML Lang tag values for the language of parts. HTML Lang is not specifically reported in accessibility frameworks. Assistive technologies would typically access the HTML DOM to get this information. This technique specifically addresses this known situation regarding how ATs obtain Language information from HTML rather than from accessibility frameworks that otherwise report other aspects of HTML content.
In order to support different language parts that each contain Silverlight content, authors declare one Silverlight object tag per continuous language part region in the HTML. For example, the following HTML is a simplication of HTML markup for a page that contains two Silverlight content areas, the first declaring Lang as English (en), the second declaring Lang as German (de):
<body> <object type="application/x-silverlight-2" lang="en"> </object> <object type="application/x-silverlight-2" lang="de"> </object> </body>
To support communication between different Silverlight plug-in instances that are hosted on the same HTML page, application authors can use various techniques, including the following
- System.Windows.Messaging APIs: this is the simplest technique, and this is shown in Example 1
- Using a shared business object, and exchanging information by having each Silverlight instance reference two-way data binding to that business object's properties.
- Exchanging information through the HTML DOM and declaring properties of one or both instances as Scriptable by the DOM.
Silverlight runtime language determination
Regardless of how HTML Lang is declared on the defining object tags, many aspects of how Silverlight works with language and culture information at run time are not determined by HTML Lang, and are instead determined by the operating system and which culture that operating system is running. For more information, see SL27: Using Language/Culture Properties as Exposed by Silverlight Applications and Assistive Technologies.
Resources are for information purposes only, no endorsement implied.
- Using a browser that supports Silverlight, open an HTML page that references multiple Silverlight object tags, each with different HTML Lang values.
- Verify that language settings through HTML Lang on object tags are respected by assistive technologies that can use HTML Lang values for language of parts determination.
#2 gives expected results.