Assigning runtime data with XAML markup extensions


show more Assigning runtime data with XAML markup extensions provides you with in-depth training on Developer. Taught by Walt Ritscher as part of the Silverlight 5 Essential Training show less
please wait ...

Assigning runtime data with XAML markup extensions

If you need runtime calculations of a value and you want to assign that value to a property in XAML, you must use a markup extension. These handy classes are placed into your XAML and they enable powerful features like binding and resource lookup. I like to review what we know about property assignments. When you assign a value to a property in your XAML, you are either passing a string to a string or you're passing the string to a type converter which converts it to the correct type. Note that the conversion happens at compile time. So in this example in the screenshot, I've got the background color being assigned Orange.

The Orange string is being passed to a type converter and turned into a solid color brush. If I want the value to be assigned at runtime, then I use this syntax here, by using Curly Braces ({}) within the attribute value, {local:LatinWords} or Background= {StaticResource warning}. There are four major categories of markup extensions built into Silverlight. Data b...

Assigning runtime data with XAML markup extensions
Video duration: 4m 21s 8h 52m Beginner

Viewers:

Assigning runtime data with XAML markup extensions provides you with in-depth training on Developer. Taught by Walt Ritscher as part of the Silverlight 5 Essential Training

Subject:
Developer
Software:
Silverlight Visual Studio
Author:
please wait ...