HTML clipboard

Introduction:

In this article, I am going demo various ways we can set property values in XAML using Silverlight. XAML provides several different ways to set property values:

  1. Simple Properties
  2. Type Converters
  3. Complex Properties
  4. Markup Extensions
  5. Attached Properties

We will see all above properties in detail.

1. Simple Properties: These are properties that provide values as simple strings. For example Content and Name property of button control.

XAML1.gif

2. Type Converters: These properties that Markup supplies as strings. For example

3. Complex Properties: These are the properties whose values are not as simple as strings but are represented as nested elements.

XAML3.gif

4. Markup Extensions: These are the properties whose values are set dynamically at runtime. The property can be set declaratively.
5. Attached Properties: Attached property is a type of global property that is settable on any object. The purpose of an attached property is to allow different child elements to specify unique values for a property that is actually defined in a parent element.
The type that defines the attached property typically follows one of these models:
Conclusion: In this article, we have seen the various ways value of property that can be set in Silverlight or WPF.