(X) Hide this Watch a recording of the recent webinar Building a Silverlight 4 application end-to-end by Gill Cleeren
View the webinar recording | Download the slides | Download the demos
Become a member to receive all webinar news by email, or follow all webinar news on Twitter | Facebook | LinkedIn
Skip Navigation LinksHome / Tips / View Tip

Tip: How to declare objects in XAML?

+ Add to SilverlightShow Favorites
0 comments   /   posted by Denislav Savkov on Sep 05, 2008
(2 votes)
Tags: Silverlight , XAML , object
Categories: General

There are two ways to declare objects in XAML. The most common way is to declare elements using opening and closing tag - using the object element syntax

XAML

<objectName><objectName/> 

It has a shorter version

XAML

<objectName/>

that can be used if the object has no child elements. See how to set a property and how to declare a child element.

The other way is to create an object indirectly by setting a property. This syntax is used relatively rare. The type or property being set is required to support type converter that takes the string value of the property. This way the object is created from the converter using a string.

That's it!

Share


Comments

Comments RSS RSS
No comments

Add Comment

 
 

   
  
  
   
Please add 3 and 8 and type the answer here: