<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>WPF</title>
        <link>http://geekswithblogs.net/RizwanSharp/category/7400.aspx</link>
        <description>WPF</description>
        <language>en-US</language>
        <copyright>RizwanSharp</copyright>
        <managingEditor>rizwansharp@hotmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>Deep Dive into XAML (Part 2 of WPF Learning Series)</title>
            <link>http://geekswithblogs.net/RizwanSharp/archive/2007/12/31/deep-dive-into-xaml-part-2-of-wpf-learning-series.aspx</link>
            <description>&lt;style type="text/css"&gt;&lt;![CDATA[

 p.msonormal1
	{margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:0in;
	line-height:115%;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	}
p.msolistparagraph
	{margin: 5.2pt 0in;
	font-size:12.0pt;
		font-family:"Times New Roman","serif";
	}]]&gt;&lt;/style&gt;
&lt;p style="line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;In &lt;a href="http://geekswithblogs.net/RizwanSharp/archive/2007/12/16/an-introduction-to-wpf-part-1-of-wpf-learning-series.aspx"&gt;&lt;span style="color: rgb(102, 153, 102);"&gt;last article&lt;/span&gt;&lt;/a&gt; we talked about WPF as a next generation UX development technology from Microsoft. We also talked about declarative programming model it provides through the use of new XML based declarative language “XAML (a.k.a Zammel)”. In this article we’ll be digging deeper in XAML by understanding its usefulness in application development and its principles by writing snippets of code.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;&lt;span style=""&gt; &lt;/span&gt;If someone is not sure of what declarative programming model is, I suggest reading &lt;a href="http://en.wikipedia.org/wiki/Declarative_programming"&gt;&lt;span style="color: rgb(102, 153, 102);"&gt;this&lt;/span&gt;&lt;/a&gt; or searching on web because this is not the part of our discussion today so I encourage you to explore it yourself.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 12pt;"&gt;What is XAML?&lt;/span&gt;&lt;/strong&gt;&lt;strong style=""&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;XAML (a.k.a Zammel) is a simple and general purpose XML based declarative language for declaring hierarchy of .Net objects which are instantiated at runtime. General purpose? Yes! It is very important to understand that XAML does not have ties to WPF and both of these can be used independently. Not to be mentioned that the use of XAML is optional when working with WPF and XAML can actually be used in other .Net technologies as well. Anything that can be done with XAML can also be done with the code of your favorite .Net language such as VB or C#.&lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;Before you loose your interest in XAML due to the above explanation and before we proceed further in learning XAML, it is important to understand why XAML is important and why it should be used for laying out UI stuff in WPF applications.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 12pt;"&gt;Why use XAML?&lt;/span&gt;&lt;/strong&gt;&lt;strong style=""&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin-left: 0.5in; text-indent: -0.25in;" class="MsoListParagraph"&gt;&lt;span style="font-size: 13.5pt; font-family: symbol;"&gt;&lt;span style=""&gt;·&lt;span times="" roman="" new=""&gt;        &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-bidi-font-size: 12.0pt" style="font-size: 10pt;"&gt;Separation of Design from Code&lt;/span&gt;&lt;/strong&gt;&lt;span trebuchet="" ms="," sans-serif="" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in 5.2pt 0.5in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;It is a good design principal to separate the UI design from the code for maintainability reasons and fortunately XAML encourages it by default. (UI stuff done in XAML and business logic in code behind) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-left: 0.5in; text-indent: -0.25in;" class="MsoListParagraph"&gt;&lt;span style="font-size: 13.5pt; font-family: symbol;"&gt;&lt;span style=""&gt;·&lt;span times="" roman="" new=""&gt;        &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-bidi-font-size: 12.0pt" style="font-size: 10pt;"&gt;Designer/Developer Collaboration&lt;/span&gt;&lt;/strong&gt;&lt;span trebuchet="" ms="," sans-serif="" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in 5.2pt 38.6pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;Most developers don’t know the use of design tools such as Expression Blend, Expression Design, Adobe Illustrator etc. Same is true for designers who don’t know C#, VB or other programming languages. So you can say there was no way before WPF or specifically XAML for a software development team to effectively work together on a software project. But now with XAML it is possible that designers create a software prototype in their favorite design tool and export XAML which can be used by developers in further development or the reverse is also true.&lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-left: 0.5in; text-indent: -0.25in;" class="MsoListParagraph"&gt;&lt;span style="font-size: 13.5pt; font-family: symbol;"&gt;&lt;span style=""&gt;·&lt;span times="" roman="" new=""&gt;        &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-bidi-font-size: 12.0pt" style="font-size: 10pt;"&gt;Easy to be Parsed, Serialized and Desterilized&lt;/span&gt;&lt;/strong&gt;&lt;span trebuchet="" ms="," sans-serif="" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in 5.2pt 38.6pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;XAML is xml based which makes it very easy to parse, serialized and desterilized XAML for dynamic UI scenarios whereas parsing C# or VB code and serializing/desterilizing it is a superb headache where only compiler designers may succeed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-left: 0.5in; text-indent: -0.25in;" class="MsoListParagraph"&gt;&lt;span style="font-size: 13.5pt; font-family: symbol;"&gt;&lt;span style=""&gt;·&lt;span times="" roman="" new=""&gt;        &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-bidi-font-size: 12.0pt" style="font-size: 10pt;"&gt;Simplicity &lt;/span&gt;&lt;/strong&gt;&lt;span trebuchet="" ms="," sans-serif="" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in 5.2pt 38.6pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;XAML is a simple language which has really short learning curve as compare to any other programming language. So it is very easy for a designer/web developer (those are already familiar with HTML) to learn it. After reading and understanding this article you’ll be in condition to validate this point.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-left: 0.5in; text-indent: -0.25in;" class="MsoListParagraph"&gt;&lt;span style="font-size: 10pt; font-family: symbol;"&gt;&lt;span style=""&gt;·&lt;span times="" roman="" new=""&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-bidi-font-size: 12.0pt" style="font-size: 10pt;"&gt;Shorter Code &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in 5.2pt 38.6pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;In most scenarios XAML code is shorter (due to shortcuts provided in it) than the code in any other language for the same output.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;To conclude the discussion of the importance of XAML in WPF we can say that though XAML is not necessary for WPF but it opens doors to a whole new world for designer/developer collaboration where they can produce a stunning output using the same underlying technology but different set of tools which interface with that differently.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;At this point, I understand that you are convinced to learn XAML so let’s get started&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: wingdings;"&gt;&lt;span style=""&gt;J&lt;/span&gt;&lt;/span&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 12pt;"&gt;Basics of XAML&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;As I mentioned previously that XAML is very easy to learn and work with if you really understand its rules which are as follow:&lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-left: 0.5in; text-indent: -0.25in;" class="MsoListParagraph"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: Arial" style="font-size: 10pt;"&gt;&lt;span style=""&gt;1.&lt;span times="" roman="" new=""&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span arial="," sans-serif="" style="font-size: 10pt;"&gt;XAML is case Sensitive like XML and C#.&lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-left: 0.5in; text-indent: -0.25in;" class="MsoListParagraph"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: Arial" style="font-size: 10pt;"&gt;&lt;span style=""&gt;2.&lt;span times="" roman="" new=""&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span arial="," sans-serif="" style="font-size: 10pt;"&gt;Each XAML document can have only one root element.&lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-left: 0.5in; text-indent: -0.25in;" class="MsoListParagraph"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: Arial" style="font-size: 10pt;"&gt;&lt;span style=""&gt;3.&lt;span times="" roman="" new=""&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span arial="," sans-serif="" style="font-size: 10pt;"&gt;Each element in XAML usually represents an object of .Net class of same name. E.g. if there is a &amp;lt;Button /&amp;gt; element, it instruct WPF to create a Button object at runtime using its default constructor. (However, sometimes elements are also used to set properties which are not otherwise expressible. We’ll be looking at this shortly in this article).&lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-left: 0.5in; text-indent: -0.25in;" class="MsoListParagraph"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: Arial" style="font-size: 10pt;"&gt;&lt;span style=""&gt;4.&lt;span times="" roman="" new=""&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span arial="," sans-serif="" style="font-size: 10pt;"&gt;On each element you can set one or more properties through attributes as we do in XML. But as mentioned previously some properties cannot be expressed through attribute syntax so we have to apply property element syntax i.e use of elements to set properties. For setting such properties we use a special syntax which makes them different from object elements.&lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-left: 0.5in; text-indent: -0.25in;" class="MsoListParagraph"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: Arial" style="font-size: 10pt;"&gt;&lt;span style=""&gt;5.&lt;span times="" roman="" new=""&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span arial="," sans-serif="" style="font-size: 10pt;"&gt;On each element you can attach one or more event handlers using the same attribute syntax as used to set properties.&lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-left: 0.5in;" class="MsoListParagraph"&gt;&lt;span trebuchet="" ms="," sans-serif="" style="font-size: 13.5pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 12pt;"&gt;Initializing Object (Object Elements) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;In XML, there is a concept of elements. Since XAML is an XML based language, same applies to XAML too. But to understand what elements in XAML mean to XAML compiler/runtime parser, let’s look at the following simple XAML code snippet: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 10pt;"&gt;XAML Code &lt;/span&gt;&lt;/strong&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Button&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt; xmlns&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation" /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 10pt;"&gt;Equivalent C# Code &lt;/span&gt;&lt;/strong&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;System.Windows.Controls.&lt;span style="color: rgb(43, 145, 175);"&gt;Button&lt;/span&gt; button = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Button&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;Both XAML and C# code are equivalent but you can test XAML’s output without compilation in XamlPad which is a tool that comes with Windows SDK V.6 and is installed by Visual Studio 2008 (code named “Orcas”). You can find this tool in &amp;lt;Programs Files&amp;gt;\Microsoft SDKs\Windows\v6.0A\Bin\. Simply open up XamlPad by running the exe and paste the above given XAML snippet in the tool and you should immediately see the output. &lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;You can also save XAML code snippet in a file with .xaml extension and open it in web browser such as Internet Explorer or Mozilla FireFox to view the output. &lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;Above given XAML code snippet when pasted in XamlPad produces the following output:&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;&lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/RizwanSharp/WindowsLiveWriter/DeepDiveintoXAMLPart2ofWPFLearningSeries_14FEC/image_8.png"&gt;&lt;img height="330" width="542" border="0" src="http://geekswithblogs.net/images/geekswithblogs_net/RizwanSharp/WindowsLiveWriter/DeepDiveintoXAMLPart2ofWPFLearningSeries_14FEC/image_thumb_3.png" alt="image" style="border-width: 0px;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p align="center" style="margin: 5.2pt 0in; line-height: normal; text-align: center;" class="MsoNormal1"&gt;&lt;a href="file:///C:/Users/RizwanSharp/AppData/Roaming/Windows%20Live%20Writer/PostSupportingFiles/a746ae0d-7744-46fc-b3e9-3505cd19da59/image4.png"&gt;&lt;span arial="," sans-serif="; TEXT-DECORATION: none; mso-fareast-font-family: 'Times New Roman'; text-underline: none; mso-no-proof: yes" style="font-size: 13.5pt; color: rgb(102, 153, 102);"&gt;&lt;v:shapetype stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600" id="_x0000_t75"&gt;&lt;v:stroke joinstyle="miter"&gt;&lt;/v:stroke&gt;&lt;v:formulas&gt;&lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @0 1 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum 0 0 @1"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @2 1 2"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @3 21600 pixelWidth"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @3 21600 pixelHeight"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @0 0 1"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @6 1 2"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @7 21600 pixelWidth"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @8 21600 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @7 21600 pixelHeight"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @10 21600 0"&gt;&lt;/v:f&gt;&lt;/v:formulas&gt;&lt;v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"&gt;&lt;/v:path&gt;&lt;o:lock aspectratio="t" v:ext="edit"&gt;&lt;/o:lock&gt;&lt;/v:shapetype&gt;&lt;v:shape alt="image" type="#_x0000_t75" o:spid="_x0000_i1027" o:button="t" href="file:///C:\Users\RizwanSharp\AppData\Roaming\Windows%20Live%20Writer\PostSupportingFiles\a746ae0d-7744-46fc-b3e9-3505cd19da59\image4.png" style="visibility: visible; width: 348pt; height: 210pt;" id="Picture_x0020_1"&gt;&lt;v:imagedata o:title="image" src="file:///C:\Users\RIZWAN~1\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png"&gt;&lt;/v:imagedata&gt;&lt;/v:shape&gt;&lt;/span&gt;&lt;/a&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;Note that XamlPad is just a handy tool to test if XAML is valid and what it produces. Also there is no intellisense support in XamlPad but visual studio 2008 provides complete intellisense support for XAML. &lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;Let’s get back our discussion in understanding role of elements in objection initialization in XAML. &lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;Declaring an XML element in XAML is equivalent to instantiating the .Net object of same name with default (parameter-less) constructor. Such element is called object element. &lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;You can also see an xml namespace declaration in previous XAML snippet but please forget about that for a little bit time and just assume that it must have to exist at the top level object element in your XAML file otherwise it will not work. &lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;So conclusion is that initializing an object in XAML is as easy as writing an XML element whose name must be the same as off the corresponding .Net object you want to initialize. &lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;It’s pretty neat and straightforward, isn’t it? I know your answer is yes of course. So let’s go ahead&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: wingdings;"&gt;&lt;span style=""&gt;J&lt;/span&gt;&lt;/span&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 12pt;"&gt;Setting Simple Properties (Property Attributes) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;In previous example we learned that how to declare an object in XAML which will be created at runtime by WPF using its default constructor. And now we have to see that how to set properties of same object in XAML. Have a look at the following code snippet: &lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 10pt;"&gt;XAML Code &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Button&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt; xmlns&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;&lt;span style=""&gt;           &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;strong style=""&gt;Content&lt;/strong&gt;&lt;/span&gt;&lt;strong style=""&gt;&lt;span style="color: blue;"&gt;="Hello XAML"&lt;/span&gt;&lt;span style="color: red;"&gt; Width&lt;/span&gt;&lt;span style="color: blue;"&gt;="200"&lt;/span&gt;&lt;span style="color: red;"&gt; Height&lt;/span&gt;&lt;span style="color: blue;"&gt;="24"&lt;/span&gt;&lt;/strong&gt;&lt;span style="color: blue;"&gt; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 10pt;"&gt;Equivalent C# Code &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(43, 145, 175);"&gt;Button&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt; button = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Button&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;button.Width = 220;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormalCxSpMiddle"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;button.Height = 24;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormalCxSpMiddle"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;button.Content = &lt;span style="color: rgb(163, 21, 21);"&gt;"Hello XAML"&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;Above given XAML code snippet when pasted in XamlPad produces the following output:&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;&lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/RizwanSharp/WindowsLiveWriter/DeepDiveintoXAMLPart2ofWPFLearningSeries_14FEC/image_10.png"&gt;&lt;img height="339" width="565" border="0" src="http://geekswithblogs.net/images/geekswithblogs_net/RizwanSharp/WindowsLiveWriter/DeepDiveintoXAMLPart2ofWPFLearningSeries_14FEC/image_thumb_4.png" alt="image" style="border-width: 0px;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p align="center" style="margin: 5.2pt 0in; line-height: normal; text-align: center;" class="MsoNormal1"&gt;&lt;a href="file:///C:/Users/RizwanSharp/AppData/Roaming/Windows%20Live%20Writer/PostSupportingFiles/a746ae0d-7744-46fc-b3e9-3505cd19da59/image12.png"&gt;&lt;span arial="," sans-serif="; TEXT-DECORATION: none; mso-fareast-font-family: 'Times New Roman'; text-underline: none; mso-no-proof: yes" style="font-size: 10pt; color: rgb(102, 153, 102);"&gt;&lt;v:shape alt="image" type="#_x0000_t75" o:spid="_x0000_i1026" o:button="t" href="file:///C:\Users\RizwanSharp\AppData\Roaming\Windows%20Live%20Writer\PostSupportingFiles\a746ae0d-7744-46fc-b3e9-3505cd19da59\image12.png" style="visibility: visible; width: 353.25pt; height: 210.75pt;" id="Picture_x0020_2"&gt;&lt;v:imagedata o:title="image" src="file:///C:\Users\RIZWAN~1\AppData\Local\Temp\msohtmlclip1\01\clip_image003.png"&gt;&lt;/v:imagedata&gt;&lt;/v:shape&gt;&lt;/span&gt;&lt;/a&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;Each attribute inside an object element represents either property or an event. (We’ll be looking at events shortly. But a thing to note is that you cannot distinguish between attributes which represent events and which represent properties unless you know them by name or use see the event or property symbols in Visual Studio’s Intellisense) &lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;An important concept to understand here is that how a string representation of some value in XAML can be assigned to some property is not of type string. For example in above example Width="200". Here comes the role of TypeConvertors which do the dirty work for you. WPF includes type convertors for many .Net types and all are inherited from TypeConvertor base class. &lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;Also, have you visualize the difference between size of XAML code and its corresponding C# code. I have already mentioned that in most cases XAML is shorter to type than some procedural code and Visual Studio even makes it fun to do with its rich intellisense support.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 12pt;"&gt;Setting Complex Properties (Property Elements)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;We have just seen that how to use attributes to set properties in XAML but in many situations it is not possible to set properties using attribute syntax in XAML because you cannot express the it complexity using a simple string as we did in last example to set three different properties. &lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;Let’s consider you need to set an image in button’s content property instead of plain text how you’ll set another button to button’s content property using property attribute syntax? Answer to this question is Property Elements. Yes, as I already mentioned that elements in XAML can also represent properties but they have special syntax so it’s indeed very easy to distinguish them from object elements. Let’ see XAML. &lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 10pt;"&gt;XAML Code&lt;/span&gt;&lt;/strong&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Button&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt; xmlns&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; text-indent: 0.5in; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;/strong&gt;&lt;strong style=""&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Button.Content&lt;/span&gt;&lt;/strong&gt;&lt;strong style=""&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;&lt;span style=""&gt;      &lt;/span&gt;&lt;span style=""&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Button&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt; Width&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;="100"&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt; Height&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;="24"&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt; Content&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;="Inner Button" /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; text-indent: 0.5in; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;/strong&gt;&lt;strong style=""&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Button.Content&lt;/span&gt;&lt;/strong&gt;&lt;strong style=""&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Button&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 10pt;"&gt;Equivalent C# Code &lt;/span&gt;&lt;/strong&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(43, 145, 175);"&gt;Button&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt; outerButton = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Button&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(43, 145, 175);"&gt;Button&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt; innerButton = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Button&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;innerButton.Width = 100;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormalCxSpMiddle"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;innerButton.Height = 24;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormalCxSpMiddle"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;outerButton.Content = innerButton;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;Above given XAML code snippet when pasted in XamlPad produces the following output:&lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p align="center" style="margin: 5.2pt 0in; line-height: normal; text-align: center;" class="MsoNormal1"&gt;&lt;a href="file:///C:/Users/RizwanSharp/AppData/Roaming/Windows%20Live%20Writer/PostSupportingFiles/a746ae0d-7744-46fc-b3e9-3505cd19da59/image17.png"&gt;&lt;span arial="," sans-serif="; TEXT-DECORATION: none; mso-fareast-font-family: 'Times New Roman'; text-underline: none; mso-no-proof: yes" style="font-size: 10pt; color: rgb(102, 153, 102);"&gt;&lt;v:shape alt="image" type="#_x0000_t75" o:spid="_x0000_i1025" o:button="t" href="file:///C:\Users\RizwanSharp\AppData\Roaming\Windows%20Live%20Writer\PostSupportingFiles\a746ae0d-7744-46fc-b3e9-3505cd19da59\image17.png" style="visibility: visible; width: 370.5pt; height: 220.5pt;" id="Picture_x0020_3"&gt;&lt;v:imagedata o:title="image" src="file:///C:\Users\RIZWAN~1\AppData\Local\Temp\msohtmlclip1\01\clip_image005.png"&gt;&lt;/v:imagedata&gt;&lt;/v:shape&gt;&lt;/span&gt;&lt;/a&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/RizwanSharp/WindowsLiveWriter/DeepDiveintoXAMLPart2ofWPFLearningSeries_14FEC/image_12.png"&gt;&lt;img height="361" width="601" border="0" src="http://geekswithblogs.net/images/geekswithblogs_net/RizwanSharp/WindowsLiveWriter/DeepDiveintoXAMLPart2ofWPFLearningSeries_14FEC/image_thumb_5.png" alt="image" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;Does this make sense to put button in button? I know you are thinking “NO” and that’s what I agree upon but I just wanted to remind one of the features of WPF I talked about in my last article i.e. “Customization and composition WPF provides where you can almost put anything in any other thing. You can even put a 3D animation, a listbox or any other control inside a button or any other item. So everything in WPF behaves like a container (parent control).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 12pt;"&gt;Attaching Event Handlers (Event Attributes) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;Attaching events in XAML is as simple as setting property with property attribute syntax which is the simplest way to set simple properties. &lt;/span&gt;&lt;span serif="; mso-fareast-font-family: 'Times New Roman'" times="" roman="," new="" style="font-size: 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;Consider this: &lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 10pt;"&gt;XAML Code &lt;/span&gt;&lt;/strong&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Button&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt; xmlns&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;&lt;span style=""&gt;           &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style=""&gt; &lt;/span&gt;Content&lt;/span&gt;&lt;span style="color: blue;"&gt;="Hello XAML"&lt;/span&gt;&lt;span style="color: red;"&gt; &lt;strong style=""&gt;Click&lt;/strong&gt;&lt;/span&gt;&lt;strong style=""&gt;&lt;span style="color: blue;"&gt;="Button_Click"&lt;/span&gt;&lt;/strong&gt;&lt;span style="color: blue;"&gt; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 10pt;"&gt;Equivalent C# Code &lt;/span&gt;&lt;/strong&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;System.Windows.Controls.&lt;span style="color: rgb(43, 145, 175);"&gt;Button&lt;/span&gt; button = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Button&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormalCxSpMiddle"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;button.Content = &lt;span style="color: rgb(163, 21, 21);"&gt;"Hello XAML"&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormalCxSpMiddle"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;button.Click += &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;RoutedEventHandler&lt;/span&gt;(button_Click);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;The above example sets both property and event attributes through the same syntax. But this code is referencing some function to handle the click event; this code cannot be viewed in XamlPad because there is not code behind file with that function. Anyway, you can fire up Visual Studio and experiment it in there without any problem. &lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;I think you have just had a sigh &lt;/span&gt;&lt;em style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 10pt;"&gt;“Ahhh”&lt;/span&gt;&lt;/em&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt; XAML is based on extremely simple rules. Now you are familiar with what elements and attributes of XML mean in XAMl, Let’s move further. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 12pt;"&gt;Namespaces &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;In previous all XAML code snippets you noticed an XML attribute which seems to be a property set with property attribute syntax but it is not. It is XML namespace to be used to find the objects in WPF assemblies. This string is hard-coded in all WPF assemblies with several instance of XmlnsDefinitionAttribute custom attribute. This is needed because XAML cannot only be dependent on element name to use to initialize object because more than one namespaces can have classes with same name. One other thing is that mapping between .Net namespace and XML namespace is not one-to-one but several .Net namespaces have same XML namespace so that XAML should remain as simple as possible. &lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;The root object element of each XAML file must contain at least one XML namespace to qualify itself and its children. Each child can have its own XML namespace in it object element but it’ll make XAML look messy. If there is need to define more than one namespaces then each additional namespace should be given a unique prefix. &lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;The good design principal is that most basic and most used namespace should be prefix free and all additional namespaces should have a small prefix. &lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;Let’s create a new WPF application in Visual Studio 2008, Visual Studio will create a Window1.xaml file with Window1.xaml.cs file for you as main window. We’ll be discussing about Window1.xaml.cs (Code behind shortly). &lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Window&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt; x&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;:&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt;Class&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;="WpfLsArticle2.Window1"&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;strong style=""&gt;xmlns&lt;/strong&gt;&lt;/span&gt;&lt;strong style=""&gt;&lt;span style="color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style=""&gt; &lt;/span&gt;xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;x&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml"&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style=""&gt; &lt;/span&gt;Title&lt;/span&gt;&lt;span style="color: blue;"&gt;="Window1"&lt;/span&gt;&lt;span style="color: red;"&gt; Height&lt;/span&gt;&lt;span style="color: blue;"&gt;="285"&lt;/span&gt;&lt;span style="color: red;"&gt; Width&lt;/span&gt;&lt;span style="color: blue;"&gt;="314"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Grid&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Grid&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Window&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;In above XAML code snippet, we can see two XAML namespaces. First is prefix free so it becomes the default namespace of entire XAML document while the second one has been prefixed with an x and it can be referred by any element with the same prefix. We have two UI elements (Window and Grid) in the above XAML document and both are prefix free so it means XAML parser locates them in all .Net namespaces which are mapped to xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation.&lt;/span&gt;&lt;span serif="; mso-fareast-font-family: 'Times New Roman'" times="" roman="," new="" style="font-size: 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;But if we want to use something from the second namespace we would do it this way:&lt;/span&gt;&lt;span serif="; mso-fareast-font-family: 'Times New Roman'" times="" roman="," new="" style="font-size: 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Window&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt; &lt;strong style=""&gt;x&lt;/strong&gt;&lt;/span&gt;&lt;strong style=""&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;:&lt;/span&gt;&lt;/strong&gt;&lt;strong style=""&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt;Class&lt;/span&gt;&lt;/strong&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;="WpfLsArticle2.Window1"&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style=""&gt; &lt;/span&gt;xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style=""&gt; &lt;/span&gt;xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;x&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml"&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style=""&gt; &lt;/span&gt;Title&lt;/span&gt;&lt;span style="color: blue;"&gt;="Window1"&lt;/span&gt;&lt;span style="color: red;"&gt; Height&lt;/span&gt;&lt;span style="color: blue;"&gt;="285"&lt;/span&gt;&lt;span style="color: red;"&gt; Width&lt;/span&gt;&lt;span style="color: blue;"&gt;="314"&lt;/span&gt;&lt;span style="color: red;"&gt; &lt;strong style=""&gt;x&lt;/strong&gt;&lt;/span&gt;&lt;strong style=""&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;Name&lt;/span&gt;&lt;span style="color: blue;"&gt;="window1"&lt;/span&gt;&lt;/strong&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Grid&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt; &lt;strong style=""&gt;x&lt;/strong&gt;&lt;/span&gt;&lt;strong style=""&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;:&lt;/span&gt;&lt;/strong&gt;&lt;strong style=""&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt;Name&lt;/span&gt;&lt;/strong&gt;&lt;strong style=""&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;="mainGrid"&lt;/span&gt;&lt;/strong&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Grid&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Window&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormalCxSpMiddle"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;In WPF it is not important to name every UI element, we can name only those items which we want to access and manipulate programmatically from the code behind this keeps XAML simplified with elimination of unnecessary attributes. There are two ways to set name of an element; one is to use its Name property but you may agree that not all classes expose Name property specially non UI classes we can still set name on such elements using XAML namespace (prefixed with an x) x:Name and the result remains the same. For consistency I personally prefer to use x:Name syntax. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 12pt;"&gt;Another Way to Set Properties (Markup Extensions) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;We have already seen two ways (property attribute and property elements) to set properties on objects in XAML but it is not desirable to hard-code the property value. Or at some time, you may need to set a property’s value to an object that already exists somewhere in your application or you may need to bind it to some other control’s property and so on. In this situation you can only get your work done with Markup Extension which is another way to set properties in XAML. Markup Extension extends the previously described property attribute and property element syntaxes to set properties. &lt;/span&gt;&lt;span serif="; mso-fareast-font-family: 'Times New Roman'" times="" roman="," new="" style="font-size: 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 10pt;"&gt;XAML Code&lt;/span&gt;&lt;/strong&gt;&lt;span serif="; mso-fareast-font-family: 'Times New Roman'" times="" roman="," new="" style="font-size: 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Button&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt; xmlns&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style="color: red;"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;x&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml"&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormalCxSpMiddle"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style="color: red;"&gt;Foreground&lt;/span&gt;&lt;span style="color: blue;"&gt;="{&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;x&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Static&lt;/span&gt;&lt;span style="color: red;"&gt; SystemColors&lt;/span&gt;&lt;span style="color: blue;"&gt;.&lt;/span&gt;&lt;span style="color: red;"&gt;ActiveCaptionBrush&lt;/span&gt;&lt;span style="color: blue;"&gt;}"&lt;/span&gt;&lt;span style="color: red;"&gt; &lt;span style=""&gt;                    &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;Content&lt;/span&gt;&lt;span style="color: blue;"&gt;="Hello"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormalCxSpMiddle"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Button&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 10pt;"&gt;Equivalent C# Code &lt;/span&gt;&lt;/strong&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormalCxSpMiddle"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(43, 145, 175);"&gt;Button&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt; button = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Button&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormalCxSpMiddle"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;button.Foreground = &lt;span style="color: rgb(43, 145, 175);"&gt;SystemColors&lt;/span&gt;.ActiveCaptionBrush;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormalCxSpMiddle"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;button.Content = &lt;span style="color: rgb(163, 21, 21);"&gt;"Hello"&lt;/span&gt;;&lt;/span&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormalCxSpMiddle"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;Markup extensions are written with curly brackes which enlose a string which evaluates to some value or object at runtime. Static identifier in the above example is the name of the markup extension class in XAML namespace prefixed with x. Such classes usually have Extension suffix with them such as StaticExtesion or NullExtension but in XAML, this prefix can be omitted. Markup extensions are very useful because they are used for data binding.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormalCxSpMiddle"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 12pt;"&gt;Code Behind Files &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;Of course XAML provides us a convenient way to define application’s UI elements in a hierarchal fashion and also helps us to integrate the other part of the world i.e. designers in application development process but application has no value without code which has your business logic and logic to manipulate the UI done in XAML. In other words, to build a true application both XAML and procedural code have to work together so let’s see how it works…&lt;/span&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt;x&lt;/span&gt;&lt;/strong&gt;&lt;strong style=""&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;:&lt;/span&gt;&lt;/strong&gt;&lt;strong style=""&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt;Class&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;="WpfLsArticle2.Window1"&lt;/span&gt;&lt;/strong&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;on Window object element&lt;/span&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;in the previous XAML document, links the two worlds together where the code behind file generated by Visual Studio looks like: &lt;/span&gt;&lt;span serif="; mso-fareast-font-family: 'Times New Roman'" times="" roman="," new="" style="font-size: 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;public&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;partial&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Window1&lt;/span&gt; : &lt;span style="color: rgb(43, 145, 175);"&gt;Window&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; text-indent: 0.5in; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;public&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt; Window1()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;&lt;span style=""&gt;      &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;&lt;span style=""&gt;      &lt;/span&gt;&lt;span style=""&gt;      &lt;/span&gt;InitializeComponent();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;&lt;span style=""&gt;      &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormalCxSpMiddle"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;}&lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormalCxSpMiddle"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;In this code behind file you can provide your event handling code.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormalCxSpMiddle"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 5.2pt; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 12pt;"&gt;XAML Compilation &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 5.2pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;A typical WPF application (with both XAML and Procedural Code) gets compiled and converted in to an assembly (.exe or .dll) in two phase process. In first phase of compilation of a WPF application, all XAML files get compiled into Binary Application Markup Language (BAML) by XAML compiler (xamlc.exe). For example, if your application has a XAML file MainWindow.xaml with its code behind in MainWindow.xaml.cs, during XAML compilation process MainWindow.xaml would get compiled into MainWindow.baml and then placed temporarily in obj\Debug or obj\Release (depending on debug or release build mode respectively). At the same time during the first phase of compilation process, a partial class would also be generated MainWindow.g.cs and placed with the BAML file (in obj\Debug or obj\Release) generated previously. This generated partial class includes code for all the fields of objects declared in window, code to load BAML, code which connects each control to its corresponding generate field and code which attached event handlers. &lt;/span&gt;&lt;span serif="; mso-fareast-font-family: 'Times New Roman'" times="" roman="," new="" style="font-size: 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;In the second phase of compilation your own partial class portion is compiled with the partial class portion generated by previous phase by your language compiler such as csc.exe in case of C#. Compiled code then becomes a single assembly and BAML files are embedded as a resource in that assembly. &lt;/span&gt;&lt;span serif="; mso-fareast-font-family: 'Times New Roman'" times="" roman="," new="" style="font-size: 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormalCxSpMiddle"&gt;&lt;em style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 10pt;"&gt;“BAML is nothing but a compact, tokenized and fast to load representation of XAML” &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormalCxSpMiddle"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 5.2pt; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 12pt;"&gt;Loading and Parsing XAML at Runtime &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 5.2pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;The coolest part of the story is that you can build or customize UI of your application on the fly by loading XAML from database or somewhere from the internet. This can be done using &lt;/span&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 10pt;"&gt;XamlReader&lt;/span&gt;&lt;/strong&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt; class in &lt;/span&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 10pt;"&gt;System.Windows.Markup&lt;/span&gt;&lt;/strong&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt; namespace. Let’s have a quick look that how it works: &lt;/span&gt;&lt;span serif="; mso-fareast-font-family: 'Times New Roman'" times="" roman="," new="" style="font-size: 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 10pt;"&gt;Create a new Project &lt;/span&gt;&lt;/strong&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;Create a new WPF Application in Visual Studio. You’ll get a Window1.xaml file in your project ready to be run as main Window of your application with following XAML document: &lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Window&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt; x&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;:&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt;Class&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;="WpfLsArticle2.Window1"&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style=""&gt; &lt;/span&gt;xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style=""&gt; &lt;/span&gt;xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;x&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml"&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style=""&gt; &lt;/span&gt;Title&lt;/span&gt;&lt;span style="color: blue;"&gt;="Window1"&lt;/span&gt;&lt;span style="color: red;"&gt; Height&lt;/span&gt;&lt;span style="color: blue;"&gt;="285"&lt;/span&gt;&lt;span style="color: red;"&gt; Width&lt;/span&gt;&lt;span style="color: blue;"&gt;="314"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Grid&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Grid&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Window&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;You’ll also get a file Window1.xaml.cs which will be having code for your event handlers. Now, we want some control to be added inside the grid of Window1 at runtime based on user role so let’s create a XAML file which looks like the following: &lt;/span&gt;&lt;span serif="; mso-fareast-font-family: 'Times New Roman'" times="" roman="," new="" style="font-size: 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 10pt;"&gt;Create a separate XAML Document &lt;/span&gt;&lt;/strong&gt;&lt;span serif="; mso-fareast-font-family: 'Times New Roman'" times="" roman="," new="" style="font-size: 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Grid&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt; &lt;span style="color: red;"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span style=""&gt; &lt;/span&gt;xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;x&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml"&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Button&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt; x&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;:&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt;Name&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;="userButton"&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt; Background&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;="Green"&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt; Content&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;="User Button" /&amp;gt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Button&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt; x&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;:&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt;Name&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;="adminButton"&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt; Background&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;="Red"&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: red;"&gt; Content&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;="Admin Button" /&amp;gt;&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt; &lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Grid&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;There must be one and only root element in each valid XAML file so we are using a Grid as a root element. Then we have added two buttons to it as you can see from the above XAML document. Lets save this document as Controls.xaml. &lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;strong&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 10pt;"&gt;Loading the XAML and Adding Controls and Runtime&lt;/span&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 13.5pt;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;span trebuchet="" ms="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;Use this code in Window’s Loaded event handler or in any other place depending on the application needs: &lt;/span&gt;&lt;span serif="; mso-fareast-font-family: 'Times New Roman'" times="" roman="," new="" style="font-size: 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt; (&lt;span style="color: rgb(43, 145, 175);"&gt;FileStream&lt;/span&gt; xamlFile = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;FileStream&lt;/span&gt;(&lt;span style="color: rgb(163, 21, 21);"&gt;"Controls.xaml"&lt;/span&gt;, &lt;span style="color: rgb(43, 145, 175);"&gt;FileMode&lt;/span&gt;.Open, &lt;span style="color: rgb(43, 145, 175);"&gt;FileAccess&lt;/span&gt;.Read)) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;{ &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;span style=""&gt;     &lt;/span&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;[] roles = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt;[] { &lt;span style="color: rgb(163, 21, 21);"&gt;"Admin"&lt;/span&gt;, &lt;span style="color: rgb(163, 21, 21);"&gt;"User"&lt;/span&gt; }; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; text-indent: 0.5in; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(43, 145, 175);"&gt;Random&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt; rand = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Random&lt;/span&gt;(); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; text-indent: 0.5in; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;int&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt; currentRoleId = rand.Next(0, 2); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; text-indent: 0.5in; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: green;"&gt;// XamlReader.Load method returns the root element of passed XAML stream. In our case it is a Grid &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; text-indent: 0.5in; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(43, 145, 175);"&gt;Grid&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt; rootElement = (&lt;span style="color: rgb(43, 145, 175);"&gt;Grid&lt;/span&gt;)&lt;span style="color: rgb(43, 145, 175);"&gt;XamlReader&lt;/span&gt;.Load(xamlFile); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; text-indent: 0.5in; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;if&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt; (&lt;span style="color: rgb(43, 145, 175);"&gt;String&lt;/span&gt;.Equals(roles[currentRoleId], &lt;span style="color: rgb(163, 21, 21);"&gt;"Admin"&lt;/span&gt;, &lt;span style="color: rgb(43, 145, 175);"&gt;StringComparison&lt;/span&gt;.Ordinal)) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; text-indent: 0.5in; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;{ &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(43, 145, 175);"&gt;Button&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt; button = (&lt;span style="color: rgb(43, 145, 175);"&gt;Button&lt;/span&gt;)rootElement.FindName(&lt;span style="color: rgb(163, 21, 21);"&gt;"adminButton"&lt;/span&gt;); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;rootElement.Children.Remove(button); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;this&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;.mainGrid.Children.Add(button); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; text-indent: 0.5in; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;} &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; text-indent: 0.5in; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;else&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (&lt;span style="color: rgb(43, 145, 175);"&gt;String&lt;/span&gt;.Equals(roles[currentRoleId], &lt;span style="color: rgb(163, 21, 21);"&gt;"User"&lt;/span&gt;, &lt;span style="color: rgb(43, 145, 175);"&gt;StringComparison&lt;/span&gt;.Ordinal)) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; text-indent: 0.5in; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;{ &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: rgb(43, 145, 175);"&gt;Button&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt; button = (&lt;span style="color: rgb(43, 145, 175);"&gt;Button&lt;/span&gt;)rootElement.FindName(&lt;span style="color: rgb(163, 21, 21);"&gt;"userButton"&lt;/span&gt;); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;rootElement.Children.Remove(button); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in; line-height: normal;" class="MsoNormal1"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt; color: blue;"&gt;this&lt;/span&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;.mainGrid.Children.Add(button); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; text-indent: 0.5in; line-height: normal;" class="MsoNormalCxSpMiddle"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;} &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormalCxSpMiddle"&gt;&lt;span courier="" new="; mso-no-proof: yes" style="font-size: 10pt;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormalCxSpMiddle"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;This is only a simplest example to show that it works&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: wingdings;"&gt;&lt;span style=""&gt;J&lt;/span&gt;&lt;/span&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt; but you can actually load very complex prebuild heirarchy and set it to some portion of UI as a content, can manipulate properties in that heirachy, attach events and so on. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormalCxSpMiddle"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 5.2pt; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 12pt;"&gt;Conclusion&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 5.2pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;XAML is a very useful and extremely simple XML based language. Though it is not necessary for WPF development but it plays a major role in WPF and commercially there may not be any WPF application without it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormalCxSpMiddle"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 5.2pt; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 12pt;"&gt;Assessment &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 5.2pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;After reading this article you should be able to understand: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; margin-left: 0.5in; text-indent: -0.25in;" class="MsoListParagraph"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: Arial" style="font-size: 10pt;"&gt;&lt;span style=""&gt;1.&lt;span times="" roman="" new=""&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span arial="," sans-serif="" style="font-size: 10pt;"&gt;Usefulness of XAML &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; margin-left: 0.5in; text-indent: -0.25in;" class="MsoListParagraph"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: Arial" style="font-size: 10pt;"&gt;&lt;span style=""&gt;2.&lt;span times="" roman="" new=""&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span arial="," sans-serif="" style="font-size: 10pt;"&gt;Role of XML Elements and Attributes in XAML &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; margin-left: 0.5in; text-indent: -0.25in;" class="MsoListParagraph"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: Arial" style="font-size: 10pt;"&gt;&lt;span style=""&gt;3.&lt;span times="" roman="" new=""&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span arial="," sans-serif="" style="font-size: 10pt;"&gt;Namespaces &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; margin-left: 0.5in; text-indent: -0.25in;" class="MsoListParagraph"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: Arial" style="font-size: 10pt;"&gt;&lt;span style=""&gt;4.&lt;span times="" roman="" new=""&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span arial="," sans-serif="" style="font-size: 10pt;"&gt;How to load, parse XAML and then use it to dynamically build some part of UI. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; margin-left: 0.5in; text-indent: -0.25in;" class="MsoListParagraph"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: Arial" style="font-size: 10pt;"&gt;&lt;span style=""&gt;5.&lt;span times="" roman="" new=""&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span arial="," sans-serif="" style="font-size: 10pt;"&gt;XAML compilation process. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; margin-left: 0.5in; text-indent: -0.25in;" class="MsoListParagraph"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: Arial" style="font-size: 10pt;"&gt;&lt;span style=""&gt;6.&lt;span times="" roman="" new=""&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span arial="," sans-serif="" style="font-size: 10pt;"&gt;BAML&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormalCxSpFirst"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 5.2pt; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 12pt;"&gt;What’s next?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 5.2pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;In next article, we’ll be talking about some new concepts introduced in WPF such as Logical and Visual Trees Routed Events etc. I’ll try my best to publish next article in next 3 days so stay tuned.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 5.2pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;Though I tried my best to go as much deep as possible but article kept growing so I missed a few things and would recommend you reading them as well.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormalCxSpLast"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;These&lt;span style=""&gt;  &lt;/span&gt;are:&lt;/span&gt;&lt;span serif="; mso-fareast-font-family: 'Times New Roman'" times="" roman="," new="" style="font-size: 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in 0pt 0.25in; text-indent: -0.25in;" class="MsoListParagraphCxSpFirst"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: Arial" style="font-size: 10pt;"&gt;&lt;span style=""&gt;1.&lt;span times="" roman="" new=""&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span arial="," sans-serif="" style="font-size: 10pt;"&gt;Attached Properties&lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in 0pt 0.25in; text-indent: -0.25in;" class="MsoListParagraphCxSpMiddle"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: Arial" style="font-size: 10pt;"&gt;&lt;span style=""&gt;2.&lt;span times="" roman="" new=""&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span arial="," sans-serif="" style="font-size: 10pt;"&gt;Handling Special Characters in XAML&lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 5.2pt 0in 0pt 0.25in; text-indent: -0.25in;" class="MsoListParagraphCxSpLast"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: Arial" style="font-size: 10pt;"&gt;&lt;span style=""&gt;3.&lt;span times="" roman="" new=""&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span arial="," sans-serif="" style="font-size: 10pt;"&gt;Content Property&lt;/span&gt;&lt;span trebuchet="" ms="," sans-serif="" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0pt; line-height: normal;" class="MsoNormalCxSpFirst"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 5.2pt; line-height: normal;" class="MsoNormal1"&gt;&lt;strong style=""&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt" style="font-size: 12pt;"&gt;Feedback&lt;/span&gt;&lt;/strong&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 5.2pt; line-height: normal;" class="MsoNormal1"&gt;&lt;span arial="," sans-serif="; mso-fareast-font-family: 'Times New Roman'" style="font-size: 10pt;"&gt;Your comments, feedbacks, suggestions, corrections and questions are most welcome. They’ll help both you and me learn the most from each other.&lt;/span&gt;&lt;span serif="; mso-fareast-font-family: 'Times New Roman'" times="" roman="," new="" style="font-size: 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118066"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118066" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/RizwanSharp/aggbug/118066.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>RizwanSharp</dc:creator>
            <guid>http://geekswithblogs.net/RizwanSharp/archive/2007/12/31/deep-dive-into-xaml-part-2-of-wpf-learning-series.aspx</guid>
            <pubDate>Mon, 31 Dec 2007 06:08:25 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/RizwanSharp/comments/118066.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/RizwanSharp/archive/2007/12/31/deep-dive-into-xaml-part-2-of-wpf-learning-series.aspx#feedback</comments>
            <slash:comments>11</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/RizwanSharp/comments/commentRss/118066.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/RizwanSharp/services/trackbacks/118066.aspx</trackback:ping>
        </item>
        <item>
            <title>An Introduction to WPF (Part 1 of WPF Learning Series)</title>
            <link>http://geekswithblogs.net/RizwanSharp/archive/2007/12/16/an-introduction-to-wpf-part-1-of-wpf-learning-series.aspx</link>
            <description>&lt;p&gt;&lt;font face="Arial" size="2"&gt;Let's start the WPF Learning Series of articles with definition and analysis of two terms which are used interchangeably when thinking of and working on Human Computer Interaction. &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;font face="Arial" size="2"&gt;User Interface (UI) vs User Experience (UX)&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;We’ve been seeing and using software for decades. Though the purpose of computer and software is still the same today when comparing to the past but the way we interact with computers today has dramatically changed the way it used to be in the past. Having a look back at 1970's, we used to interact with computers with a command-line user-interface where we had to issue some text based commands to a computer, having computer process those commands and returning some results back on the console in the same text based manner. Computers through the software they were running used to notify us if we had typed something wrong which was not understandable by it and/or ultimately telling the things to make sure to rectify the errors to proceed further. &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;As mentioned above, the purpose of computer and software today is still the same as it used to be in the past but human computer interaction is much more mature today. Our interaction with computer is not only based on a typical input device which enables us to input some text commands and a black &amp;amp; white screen to see the results back. Today, we interact with computers in more natural way (the way, we do with other living things in our environment). It’s not a fiction anymore to interact with computers through voice commands and some sophisticated types of input/output devices which ultimately make the experience very natural for computer users. Imagine a world of computer where everything looks and behaves like a real object; a received email pops up a letter symbol in front of you with a sound, you open it with your hands by touching the screen, letter unfolds itself in front of you with sound and so on. This all has been made possible due to collective advancements in software and hardware technologies. Today, it’s not a luxury to have 1 GB of memory, high speed and high capacity hard disk, a good GPU, a high speed CPU, and a plethora of types of input/output devices. &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;To conclude the discussion on User Interface and User Experience, we can say that UI is just a component of a larger term UX where UI with other components collectively make the user experience better. And UX is all a user’s experiences from software interaction point of view. So ideally speaking, a UX can incorporate basic input controls, 2D and 3D animations, audio and speech capabilities and other media. &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;font face="Arial" size="2"&gt;Where the inspiration comes from?&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;Inspiration to work on a technology like WPF comes from the limitation of previous technologies used by developers to develop a better UX. There were/are technologies available like GDI to build basic UI and technologies like DirectX and OpenGL for building UX for games but what if a business developer needs some cool UX in the software he/she is working on? He/She had to learn different technologies to make this happen. Argh… What’s this? One software, more than one technologies just for a single UX. On the other hand, frankly speaking DirectX and OpenGL are not really for a business developer but these are the technologies for game programmers who are well aware of all that geometry stuff to rotate some sphere, showing shadows, managing views and bla bla. A typical business developer is more concerned with the task in hand that how to validate this information, how data is being processed and how to present and save results. Why he would learn geometry stuff to handle different aspects of graphics, which is a really time consuming work. &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;As a result of this, many UX designers ended up using gradient styled images on the back of windows, containers and buttons, and using animated images (GIFs) for the animation effects which they could not even start and stop or changing the flow programmatically. And others started buying some third party controls, though these controls were better looking than the standard set of controls available to windows programmers but they also had some limitations like not being able to paint some special area of control, seeing a killing flicker while resizing them and so on plus these were full of un-resolved bugs.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;font face="Arial" size="2"&gt;What is WPF?&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;In simple, Windows Presentation Foundation is a rich set of libraries (API) for UX development which is accessible by both designers and developers through a declarative language called “Extensible Markup Language” (XAML). In this article, we are just focusing on introduction to WPF and its usefulness in UX and I'll be ignoring XAML for now. We’ll be looking at XAMl “zammel” in detail in the next article. WPF is the technology which makes it possible to very easily build better UXs incorporating all the components and features explained above. WPF is one of the four technologies added to version two of .Net Framework ultimately making it .Net 3.0. So what you need to have installed on your machine is .Net Framework 3.0 or above to run a WPF application.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;font face="Arial" size="2"&gt;Features of WPF&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;There was really a need of some nice technology which may address all those issues, providing a concise and unified programming model etc. Fortunately today, we have WPF.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;WPF has the following features:&lt;/font&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;font size="2"&gt;&lt;font face="Arial"&gt;&lt;b&gt;Rich Integration:&lt;/b&gt; &lt;/font&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Arial" size="2"&gt;As mentioned above that in the past, if a developer needed to incorporate animation and/or speech support in UX of a software, he/she needed to learn other technologies which was really not desired by him/her. Using the WPF, its now possible to incorporate nice looking UI elements, 2D and 3D animations, audio, video, speech in the UX of a software. WPF not only provides a built in support for all the types of media which a developer may wish to incorporate in the software UX he/she is working on but also a consistent programming model to access all those resources.&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;li&gt;&lt;font size="2"&gt;&lt;font face="Arial"&gt;&lt;b&gt;Resolution Independence:&lt;/b&gt; &lt;/font&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Arial" size="2"&gt;In WPF world it does not matter if you see the visual part of a software on and 15” monitor or on a 60” plasma screen because WPF is based on vector graphics and vector graphics are resolution independent which means that they are redrawn to suite the underlying resolution of a screen on which they are being viewed.&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;li&gt;&lt;font size="2"&gt;&lt;font face="Arial"&gt;&lt;b&gt;Hardware Acceleration&lt;/b&gt; &lt;/font&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Arial" size="2"&gt;Internally, WPF uses Direct3D which is a part of DirectX and Direct3D uses hardware acceleration which means that all rendering work is offloaded to the Graphics Processing Unit (GPU) which is able to do such type of work faster than a general purpose CPU can do. But in case there is no capable GPU hardware available on machine WPF manages it the other way.&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;li&gt;&lt;font size="2"&gt;&lt;font face="Arial"&gt;&lt;b&gt;Declarative Programming&lt;/b&gt; &lt;/font&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Arial" size="2"&gt;WPF provides a consistent declarative programming model through Extensible application Markup Language (XAML) using which you define the objects’ hierarchy and relationship and leave the rest to be done by parser and compiler. XAML, being a consistent language lets both designers and developers can contribute on a single project because tools used by both group of people understand XAML. (we’ll be talking on XAML in detail in the next article)&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;li&gt;&lt;font size="2"&gt;&lt;font face="Arial"&gt;&lt;b&gt;Backward Compatibility&lt;/b&gt; &lt;/font&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Arial" size="2"&gt;WPF provides backward compatibility with previous Microsoft technologies like Windows Forms and ActiveX. It means your existing investments are secured and Windows Forms and ActiveX controls can still be used the same way in WPF application. We’ll address the topic in one of the future articles when talking about the WPF Inheritability.&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;li&gt;&lt;font size="2"&gt;&lt;font face="Arial"&gt;&lt;b&gt;Types of Applications&lt;/b&gt; &lt;/font&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Arial" size="2"&gt;In WPF, you can create both a standalone application which compiles to an .exe file as well as an application which can be hosted in a browser such as Internet Explorer from Microsoft and compiles to XBAP. And the good thing is that for targeting both types of applications, we follow the same programming model. We’ll be looking at the topic in future articles.&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;b&gt;&lt;font face="Arial" size="2"&gt;What WPF can Do?&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;I hope you have seen Microsoft Surface Computing Platform, Yes you can see the power of WPF in Microsoft Surface computer. For more information please have a look at &lt;/font&gt;&lt;a href="http://www.microsoft.com/surface/"&gt;&lt;font face="Arial" size="2"&gt;this&lt;/font&gt;&lt;/a&gt;&lt;font face="Arial" size="2"&gt;.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;Yahoo Inc. has also implemented a new version of it famous IM client “Yahoo Messenger” for Windows Vista in WPF. If you are running Windows Vista, you can download from &lt;/font&gt;&lt;a href="http://messenger.yahoo.com/windowsvista.php"&gt;&lt;font face="Arial" size="2"&gt;here&lt;/font&gt;&lt;/a&gt;&lt;font face="Arial" size="2"&gt; and play with it.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;And Last but not least, New York Times Reader &lt;/font&gt;&lt;a href="http://www.readwriteweb.com/archives/times_reader_launches.php"&gt;&lt;font face="Arial" size="2"&gt;Application&lt;/font&gt;&lt;/a&gt;&lt;font face="Arial" size="2"&gt; has also been developed in WPF.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;Here I’m linking to some of the URLs of browser hosted WPF applications (XBAP) on which you can have a look to see what kind of experience WPF can provide.&lt;/font&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;a href="http://www.mobiform.com/demos/avalonclock/WebAvalonClock.xbap"&gt;&lt;font face="Arial" size="2"&gt;WPF Analog Clock&lt;/font&gt;&lt;/a&gt;&lt;font face="Arial" size="2"&gt; &lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://scorbs.com/workapps/woodgrove/FinanceApplication.xbap"&gt;&lt;font face="Arial" size="2"&gt;WoodGrove Finance Application&lt;/font&gt;&lt;/a&gt;&lt;font face="Arial" size="2"&gt; &lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://download3.xceedsoft.com/demo/gridwpf/Xceed.Wpf.DataGrid.Samples.LiveExplorer.xbap"&gt;&lt;font face="Arial" size="2"&gt;Xceed WPF Data Grid&lt;/font&gt;&lt;/a&gt;&lt;font face="Arial" size="2"&gt; &lt;/font&gt;&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;These are just the examples of what we can do with WPF.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;font face="Arial" size="2"&gt;Conclusion&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;WPF is the technology which will be used to build rich user experiences on the windows platform in next few years and make the fictions possible you used to see about the software UX in movies.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;font face="Arial" size="2"&gt;Assessment&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;After reading this article you should be able to define:&lt;/font&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;font face="Arial" size="2"&gt;Difference between UI and UX &lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font face="Arial" size="2"&gt;What is WPF? &lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font face="Arial" size="2"&gt;Resolution Independence. &lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font face="Arial" size="2"&gt;Hardware Acceleration. &lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font face="Arial" size="2"&gt;Types of applications built with WPF. &lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font face="Arial" size="2"&gt;Declarative Programming Model. &lt;/font&gt;&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;b&gt;&lt;font face="Arial" size="2"&gt;What's next?&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;This article was all theoretical and may have bored some of the readers who are always eager to write some code but it was important to understand the basic knowledge of what is WPF and why it should be learned and used? Plus beginners should also get maximum output from the WPF. In the next article (within a week), we’ll be looking at XAML so we’ll be writing some code in both XAML and C#.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;So, if you have joined me in WPF learning and are interested in the next articles, please get your machines equipped with:&lt;/font&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;font face="Arial" size="2"&gt;Microsoft Visual Studio 2008 &lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font face="Arial" size="2"&gt;Microsoft Expression Blend &lt;/font&gt;&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;b&gt;&lt;font face="Arial" size="2"&gt;&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;font face="Arial" size="2"&gt;Feedback&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;I’m looking forward for your comments, recommendations and questions...&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;Best Regards &amp;amp; Best of Luck,&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;Rizwan a.k.a RizwanSharp&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=117763"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=117763" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/RizwanSharp/aggbug/117763.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>RizwanSharp</dc:creator>
            <guid>http://geekswithblogs.net/RizwanSharp/archive/2007/12/16/an-introduction-to-wpf-part-1-of-wpf-learning-series.aspx</guid>
            <pubDate>Mon, 17 Dec 2007 05:20:31 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/RizwanSharp/comments/117763.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/RizwanSharp/archive/2007/12/16/an-introduction-to-wpf-part-1-of-wpf-learning-series.aspx#feedback</comments>
            <slash:comments>22</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/RizwanSharp/comments/commentRss/117763.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/RizwanSharp/services/trackbacks/117763.aspx</trackback:ping>
        </item>
    </channel>
</rss>