ARTICLE

Custom Markup Extensions in Silverlight 5: Part 1

Posted by Mahadesh Mahalingappa Articles | Silverlight with C# August 20, 2011
In this article we are going to learn about the Custom Markup Extensions in Silverlight 5 .
Reader Level:
Download Files:
 

In this article we are going to learn about the Custom Markup Extensions in Silverlight 5 .

Created a new project SLCustomMarkup . Make sure that the Targeted Silverlight Version is Silverlight 5 .


CMESil1.gif

Create a class say FirstCME

CMESil2.gif

Lets start typing in the code . I implement the interface IMarkupExtension<T> here .

CMESil3.gif


CMESil4.gif


CMESil5.gif

CMESil6.gif

CMESil7.gif


Lets have a look at how the Interface ImarkupExtension<T> looks:

CMESil8.gif


CMESil9.gif

Lets now add a TextBlock and bind the text of it to FirstCME Extension which we had created .

CMESil10.gif

The Silverlight parser creates a instance of FirstCME and assigns the value of the property to the Text of the TextBlock .

Now we are done . Lets give it a run :

CMESil11.gif

Login to add your contents and source code to this article
post comment
     

Good Article............

Posted by Shalini Juneja Aug 22, 2011
COMMENT USING
PREMIUM SPONSORS
DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.
Get Career Advice from Experts
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.