<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Desperately Seeking Love of Sophie</title>
	<atom:link href="http://vivekdalvi.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://vivekdalvi.wordpress.com</link>
	<description></description>
	<lastBuildDate>Mon, 02 Jan 2012 00:23:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='vivekdalvi.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Desperately Seeking Love of Sophie</title>
		<link>http://vivekdalvi.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://vivekdalvi.wordpress.com/osd.xml" title="Desperately Seeking Love of Sophie" />
	<atom:link rel='hub' href='http://vivekdalvi.wordpress.com/?pushpress=hub'/>
		<item>
		<title>CodePlex for PAX and PAX-Reflector Addin</title>
		<link>http://vivekdalvi.wordpress.com/2008/11/17/codeplex-for-pax-and-pax-reflector-addin/</link>
		<comments>http://vivekdalvi.wordpress.com/2008/11/17/codeplex-for-pax-and-pax-reflector-addin/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 18:23:05 +0000</pubDate>
		<dc:creator>Vivek</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://vivekdalvi.wordpress.com/2008/11/17/codeplex-for-pax-and-pax-reflector-addin/</guid>
		<description><![CDATA[Just published a CodePlex projects for PAX and PAX reflector addin. PAX http://www.codeplex.com/PaxPlatform PAX-Reflector Addin http://www.codeplex.com/PaxReflector Technorati Tags: Silverlight,Reflector,PAX<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekdalvi.wordpress.com&amp;blog=489653&amp;post=305&amp;subd=vivekdalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Just published a CodePlex projects for PAX and PAX reflector addin. </p>
<h3>PAX</h3>
<p><a title="http://www.codeplex.com/PaxPlatform" href="http://www.codeplex.com/PaxPlatform">http://www.codeplex.com/PaxPlatform</a></p>
<h3>PAX-Reflector Addin</h3>
<p><a title="http://www.codeplex.com/PaxReflector" href="http://www.codeplex.com/PaxReflector">http://www.codeplex.com/PaxReflector</a></p>
<div style="display:inline;margin:0;padding:0;" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:a419bcbf-1533-482e-bdf1-dfcd78be793c" class="wlWriterSmartContent">Technorati Tags: <a href="http://technorati.com/tags/Silverlight" rel="tag">Silverlight</a>,<a href="http://technorati.com/tags/Reflector" rel="tag">Reflector</a>,<a href="http://technorati.com/tags/PAX" rel="tag">PAX</a></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekdalvi.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekdalvi.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekdalvi.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekdalvi.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vivekdalvi.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vivekdalvi.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vivekdalvi.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vivekdalvi.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekdalvi.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekdalvi.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekdalvi.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekdalvi.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekdalvi.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekdalvi.wordpress.com/305/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekdalvi.wordpress.com&amp;blog=489653&amp;post=305&amp;subd=vivekdalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vivekdalvi.wordpress.com/2008/11/17/codeplex-for-pax-and-pax-reflector-addin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/347fa7a1437be365f8a78982e6fe414d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vivekdalvi</media:title>
		</media:content>
	</item>
		<item>
		<title>Pax-Reflector Plugin</title>
		<link>http://vivekdalvi.wordpress.com/2008/11/12/pax-reflector-plugin/</link>
		<comments>http://vivekdalvi.wordpress.com/2008/11/12/pax-reflector-plugin/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 01:07:55 +0000</pubDate>
		<dc:creator>Vivek</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://vivekdalvi.wordpress.com/2008/11/12/pax-reflector-plugin/</guid>
		<description><![CDATA[Technorati Tags: Silverlight,PAX Logical progression for PAX was build some kind of UI around it. I thought of writing my UI but then I realized the building&#160; a UI for assembly parts and letting people look at the code inside it is not a small task and there is already a tool for it i.e. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekdalvi.wordpress.com&amp;blog=489653&amp;post=303&amp;subd=vivekdalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[</p>
<div style="display:inline;margin:0;padding:0;" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:efd0e289-5c9a-453e-95bd-84fa6665475f" class="wlWriterSmartContent">Technorati Tags: <a href="http://technorati.com/tags/Silverlight" rel="tag">Silverlight</a>,<a href="http://technorati.com/tags/PAX" rel="tag">PAX</a></div>
<p> Logical progression for <a href="http://vivekdalvi.wordpress.com/2008/11/04/pax/">PAX</a> was build some kind of UI around it. I thought of writing my UI but then I realized the building&nbsp; a UI for assembly parts and letting people look at the code inside it is not a small task and there is already a tool for it i.e. .Net <a href="http://www.red-gate.com/products/reflector/index.htm">Reflector</a>. There is even nice Add-in model that lets you extend reflector functionality. Here are few things I found that were helpful for me to create this add-in.</p>
<ul>
<li><a title="http://www.codeplex.com/reflectoraddins/Wiki/View.aspx?title=Documentation&amp;referringTitle=Home" href="http://www.codeplex.com/reflectoraddins/Wiki/View.aspx?title=Documentation&amp;referringTitle=Home">http://www.codeplex.com/reflectoraddins/Wiki/View.aspx?title=Documentation&amp;referringTitle=Home</a></li>
<li><a title="http://jasonhaley.com/blog/archive/2007/02/26/138105.aspx" href="http://jasonhaley.com/blog/archive/2007/02/26/138105.aspx">http://jasonhaley.com/blog/archive/2007/02/26/138105.aspx</a></li>
<li><a title="http://jasonhaley.com/blog/archive/2007/08/25/140286.aspx" href="http://jasonhaley.com/blog/archive/2007/08/25/140286.aspx">http://jasonhaley.com/blog/archive/2007/08/25/140286.aspx</a></li>
</ul>
<p>This is add-in is pretty simple. It adds a menu item to File menu. Open Xap menu launches a <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.openfiledialog.aspx">OpenFileDialog</a> that lets user pick a Xap file that they would like to see. </p>
<p><a href="http://lh5.ggpht.com/_6hZ5PMG03Es/SRtbPqM_fXI/AAAAAAAADLg/dUbUFrLuYqs/s1600-h/Fileopen%5B2%5D.png"><img style="border-width:0;" border="0" alt="Fileopen" src="http://lh6.ggpht.com/_6hZ5PMG03Es/SRtbQQSp4mI/AAAAAAAADLk/FuXHZG_jJa0/Fileopen_thumb.png?imgmax=800" width="209" height="244"></a> </p>
<p>When user picks the file, it opens the xap in tree view structure. User can then expand them to see individual files inside it.</p>
<p><a href="http://lh3.ggpht.com/_6hZ5PMG03Es/SRtbQx9Yf4I/AAAAAAAADLo/Iz1vWskU0q0/s1600-h/treeview%5B2%5D.png"><img style="border-width:0;" border="0" alt="treeview" src="http://lh3.ggpht.com/_6hZ5PMG03Es/SRtbRab-SkI/AAAAAAAADLs/Ko5mrSQJ8MY/treeview_thumb.png?imgmax=800" width="244" height="137"></a>&nbsp;<a href="http://lh3.ggpht.com/_6hZ5PMG03Es/SRtbSLU7j0I/AAAAAAAADLw/10BkTRvogeo/s1600-h/expandedtreeview%5B2%5D.png"><img style="border-width:0;" border="0" alt="expandedtreeview" src="http://lh4.ggpht.com/_6hZ5PMG03Es/SRtbS4BViDI/AAAAAAAADL0/b_KGIji_zXs/expandedtreeview_thumb.png?imgmax=800" width="149" height="244"></a> </p>
<p>User can click on some of the files to see the content. E.g. for Xaml File text is shown. For image, image is shown and for Media files, media is played. </p>
<p><a href="http://lh4.ggpht.com/_6hZ5PMG03Es/SRtbTtNOaGI/AAAAAAAADL4/IIQkVD9JCPA/s1600-h/xamlview%5B2%5D.png"><img style="border-width:0;" border="0" alt="xamlview" src="http://lh6.ggpht.com/_6hZ5PMG03Es/SRtbUQhFA3I/AAAAAAAADL8/blEd67U2DtI/xamlview_thumb.png?imgmax=800" width="244" height="140"></a> <a href="http://lh4.ggpht.com/_6hZ5PMG03Es/SRtbVZUPYuI/AAAAAAAADMA/H_f3eZVepvk/s1600-h/mediaview%5B2%5D.png"><img style="border-width:0;" border="0" alt="mediaview" src="http://lh4.ggpht.com/_6hZ5PMG03Es/SRtbWLbgkCI/AAAAAAAADMI/l2QfaP5TD1U/mediaview_thumb.png?imgmax=800" width="244" height="159"></a> </p>
<p><a href="http://blogs.msdn.com/vivekd/attachment/9064876.ashx">Here</a> is the source code for the project. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekdalvi.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekdalvi.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekdalvi.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekdalvi.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vivekdalvi.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vivekdalvi.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vivekdalvi.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vivekdalvi.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekdalvi.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekdalvi.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekdalvi.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekdalvi.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekdalvi.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekdalvi.wordpress.com/303/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekdalvi.wordpress.com&amp;blog=489653&amp;post=303&amp;subd=vivekdalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vivekdalvi.wordpress.com/2008/11/12/pax-reflector-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/347fa7a1437be365f8a78982e6fe414d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vivekdalvi</media:title>
		</media:content>

		<media:content url="http://lh6.ggpht.com/_6hZ5PMG03Es/SRtbQQSp4mI/AAAAAAAADLk/FuXHZG_jJa0/Fileopen_thumb.png?imgmax=800" medium="image">
			<media:title type="html">Fileopen</media:title>
		</media:content>

		<media:content url="http://lh3.ggpht.com/_6hZ5PMG03Es/SRtbRab-SkI/AAAAAAAADLs/Ko5mrSQJ8MY/treeview_thumb.png?imgmax=800" medium="image">
			<media:title type="html">treeview</media:title>
		</media:content>

		<media:content url="http://lh4.ggpht.com/_6hZ5PMG03Es/SRtbS4BViDI/AAAAAAAADL0/b_KGIji_zXs/expandedtreeview_thumb.png?imgmax=800" medium="image">
			<media:title type="html">expandedtreeview</media:title>
		</media:content>

		<media:content url="http://lh6.ggpht.com/_6hZ5PMG03Es/SRtbUQhFA3I/AAAAAAAADL8/blEd67U2DtI/xamlview_thumb.png?imgmax=800" medium="image">
			<media:title type="html">xamlview</media:title>
		</media:content>

		<media:content url="http://lh4.ggpht.com/_6hZ5PMG03Es/SRtbWLbgkCI/AAAAAAAADMI/l2QfaP5TD1U/mediaview_thumb.png?imgmax=800" medium="image">
			<media:title type="html">mediaview</media:title>
		</media:content>
	</item>
		<item>
		<title>Pax</title>
		<link>http://vivekdalvi.wordpress.com/2008/11/04/pax/</link>
		<comments>http://vivekdalvi.wordpress.com/2008/11/04/pax/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 21:22:04 +0000</pubDate>
		<dc:creator>Vivek</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://vivekdalvi.wordpress.com/2008/11/04/pax/</guid>
		<description><![CDATA[Silverlight app file (.XAP) is essentially a zip file. For testing purposes, many times we needed to look inside the XAP file from customers to see what was causing an issue. It is possible to day to see what exactly is inside the .Xap file today but it involves few&#160; steps&#8230;. Extract all the contents [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekdalvi.wordpress.com&amp;blog=489653&amp;post=298&amp;subd=vivekdalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Silverlight app file (.XAP) is essentially a zip file. For testing purposes, many times we needed to look inside the XAP file from customers to see what was causing an issue. </p>
<p>It is possible to day to see what exactly is inside the .Xap file today but it involves few&#160; steps&#8230;.</p>
<ol>
<li>Extract all the contents out of Zip file </li>
<li>you should be having bunch of resource files (.mpg, jpg, .wmv etc) and assemblies (.dll) and Application manifest (app.xaml) </li>
<li>Then most of the pages etc are embedded in the assembly so now you can use one of the tools (such as ILDASM) to extract resources out of there to see what is embedded in side assembly </li>
</ol>
<p>In short it was kind of painful process. I wanted to write some utility assembly that exposes all this information out of Xap in a easier way. These utility APIs could be used to build UI around it.</p>
<p><strong>[Before we get into details of PAX, big Thanks to Eduardo for helping me cleanup the code and fix some of the issues]</strong></p>
<p>There are two DLLs….</p>
<h2>ArchiveModel</h2>
<p>This DLL contains classes and APIs that read the Zip (Deflate) format that is used for creating .Xap files for silverlight. It has following classes </p>
<p><img alt="" src="http://upload.wikimedia.org/wikipedia/en/b/b3/ZIPformat.jpg" /> </p>
<p><a href="http://vivekdalvipic1.files.wordpress.com/2008/11/image.png"><img title="image" style="display:inline;border-width:0;" height="209" alt="image" src="http://vivekdalvipic1.files.wordpress.com/2008/11/image-thumb.png?w=244&#038;h=209" width="244" border="0" /></a> </p>
<h4>Archive</h4>
<p>This class represents a zip file. It exposes the Files collection that are inside zip as well as ReadFiles method that reads individual files (stored in Files Collection). </p>
<h4>ArchiveFile</h4>
<p>This class represents individual files inside Zip file. Every ArchiveFile has ArchiveFileHeader as well as method ReadFile to read the file. ReadFile method is actuall what decompresses the content using DeflateStream class. </p>
<h4>ArchiveFileHeader</h4>
<p>Each file in the zip format has a header. Header contains lot of information that is used to read the actual content of the file. Header exposes properties such as Compressed/Uncompressed size, last modified date, filename etc</p>
<h4>ByteReader</h4>
<p>This is a utility class that converts the array of Bytes into types that are needed for PAX. </p>
<h2>XapModel</h2>
<p>This DLL that contains classes and APIs that introduces the concept of XAP. e.g. Every XAP has a manifest file, it can contain assemblies and resources etc. It has following classes</p>
<p><a href="http://vivekdalvipic1.files.wordpress.com/2008/11/image1.png"><img title="image" style="display:inline;border-width:0;" height="166" alt="image" src="http://vivekdalvipic1.files.wordpress.com/2008/11/image-thumb1.png?w=244&#038;h=166" width="244" border="0" /></a></p>
<p><a href="http://vivekdalvipic1.files.wordpress.com/2008/11/image2.png"><img title="image" style="display:inline;border-width:0;" height="185" alt="image" src="http://vivekdalvipic1.files.wordpress.com/2008/11/image-thumb2.png?w=244&#038;h=185" width="244" border="0" /></a></p>
<h4>XapArchive</h4>
<p>This class represents individual XAP file. It exposes Files collection that contains individual files inside Xap. It also exposes property for manifest. </p>
<h4>File and its Sub classes</h4>
<p>This class represents generic file inside a xap. File is a base class for different type of files (assemblyfile, manifestfile, xamlfile etc). File can be inside xap or inside assembly. Currently only ManifestFile class implements validation logic using Schemas but in general every file class could have some validation logic. That is the reason why VideoFile/AudioFile classes exists but are empty today. </p>
<h4>FileProperties </h4>
<p>This class represents the metadata about a file in xap such as&#160; compressed size, uncompressed size etc</p>
<h2>Use of Pax</h2>
<p>Here is a very simple way I can use the PAX to list the properties of files inside a given xap.</p>
<pre class="code"><span style="color:blue;">using </span>System;
<span style="color:blue;">using </span>XapModel;
<span style="color:blue;">using </span>System.IO;

<span style="color:blue;">namespace </span>PaxConsoleTest
{
    <span style="color:blue;">class </span><span style="color:#2b91af;">Program
    </span>{
        <span style="color:blue;">static </span><span style="color:#2b91af;">XapArchive </span>_xap;

        <span style="color:blue;">static void </span>Main(<span style="color:blue;">string</span>[] args)
        {
            <span style="color:blue;">using </span>(<span style="color:#2b91af;">FileStream </span>fs = <span style="color:blue;">new </span><span style="color:#2b91af;">FileStream</span>(<span style="color:#a31515;">&quot;TestPax.xap&quot;</span>, <span style="color:#2b91af;">FileMode</span>.Open))
            {
                _xap = <span style="color:blue;">new </span><span style="color:#2b91af;">XapArchive</span>(fs);
                WriteFileProperties(_xap.Manifest);
                <span style="color:blue;">foreach </span>(XapModel.FileTypes.<span style="color:#2b91af;">File </span>file <span style="color:blue;">in </span>_xap.Files)
                {
                    WriteFileProperties(file);
                    <span style="color:blue;">if </span>(file <span style="color:blue;">is </span>XapModel.FileTypes.<span style="color:#2b91af;">AssemblyFile</span>)
                    {
                        <span style="color:blue;">foreach </span>(XapModel.FileTypes.<span style="color:#2b91af;">File </span>embeddedfile <span style="color:blue;">in </span>                                   ((XapModel.FileTypes.<span style="color:#2b91af;">AssemblyFile</span>)file).Resources)
                        {
                            WriteFileProperties(embeddedfile);
                        }
                    }
                }
            }
        }

        <span style="color:blue;">private static void </span>WriteFileProperties(XapModel.FileTypes.<span style="color:#2b91af;">File </span>file)
        {
            <span style="color:#2b91af;">Console</span>.WriteLine();
            <span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">&quot;************************************&quot;</span>);
            <span style="color:#2b91af;">Console</span>.WriteLine(
                <span style="color:#a31515;">&quot;File Name: &quot; </span>+ file.FileProperties.FileName +
                <span style="color:#a31515;">&quot;         Last Modified: &quot; </span>+ file.FileProperties.LastModified);
            <span style="color:#2b91af;">Console</span>.WriteLine(
                <span style="color:#a31515;">&quot;Compressed Size: &quot; </span>+ file.FileProperties.CompressedSize +
                <span style="color:#a31515;">&quot;         Uncompressed Size: &quot; </span>+ file.FileProperties.UncompressedSize);
            <span style="color:#2b91af;">Console</span>.Write(<span style="color:#a31515;">&quot;************************************&quot;</span>);
            <span style="color:#2b91af;">Console</span>.WriteLine();
        }
    }
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>which produces output such as </p>
<p><font face="Lucida Console" color="#800000" size="2"><strong>************************************<br />
      <br />File Name: AppManifest.xaml&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Last Modified: 10/22/2008 10:06:14 PM </p>
<p>Compressed Size: 300&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Uncompressed Size: 337 </p>
<p>************************************ </strong></font></p>
<p><font face="Lucida Console" color="#800000" size="2"><strong>************************************<br />
      <br />File Name: TestPax.dll&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Last Modified: 10/22/2008 10:06:14 PM </p>
<p>Compressed Size: 21189226&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Uncompressed Size: 21720064 </p>
<p>************************************ </strong></font></p>
<p><font face="Lucida Console" color="#800000" size="2"><strong>************************************<br />
      <br />File Name: TestPax.g.resources/page.xaml&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Last Modified: 1/1/0001 12:00:00 AM </p>
<p>Compressed Size: 0&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Uncompressed Size: 286 </p>
<p>************************************ </strong></font></p>
<p><font face="Lucida Console" color="#800000" size="2"><strong>************************************<br />
      <br />File Name: TestPax.g.resources/asmembedded/asmembeddedvideowmv.wmv&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Last Modified: 1/1/0001 </p>
<p>2:00:00 AM </p>
<p>Compressed Size: 0&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Uncompressed Size: 4045744 </p>
<p>************************************ </strong></font></p>
<p><font face="Lucida Console" color="#800000" size="2"><strong>************************************<br />
      <br />File Name: TestPax.g.resources/asmembedded/asmembdimgjpeg.jpeg&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Last Modified: 1/1/0001 12: </p>
<p>:00 AM </p>
<p>Compressed Size: 0&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Uncompressed Size: 3495</strong></font></p>
<div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:6b48be15-86dc-4871-9e98-173ffc5d0108" style="display:inline;float:none;margin:0;padding:0;">Technorati Tags: <a href="http://technorati.com/tags/Silverlight" rel="tag">Silverlight</a>,<a href="http://technorati.com/tags/Pax" rel="tag">Pax</a>,<a href="http://technorati.com/tags/Xap" rel="tag">Xap</a>,<a href="http://technorati.com/tags/Archive" rel="tag">Archive</a></div>
</p>
<p><a href="http://blogs.msdn.com/vivekd/attachment/9041544.ashx">Here</a> is the link to code to code for Pax</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekdalvi.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekdalvi.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekdalvi.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekdalvi.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vivekdalvi.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vivekdalvi.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vivekdalvi.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vivekdalvi.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekdalvi.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekdalvi.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekdalvi.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekdalvi.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekdalvi.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekdalvi.wordpress.com/298/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekdalvi.wordpress.com&amp;blog=489653&amp;post=298&amp;subd=vivekdalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vivekdalvi.wordpress.com/2008/11/04/pax/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/347fa7a1437be365f8a78982e6fe414d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vivekdalvi</media:title>
		</media:content>

		<media:content url="http://upload.wikimedia.org/wikipedia/en/b/b3/ZIPformat.jpg" medium="image" />

		<media:content url="http://vivekdalvipic1.files.wordpress.com/2008/11/image-thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://vivekdalvipic1.files.wordpress.com/2008/11/image-thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://vivekdalvipic1.files.wordpress.com/2008/11/image-thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Pictures at Santa Monica</title>
		<link>http://vivekdalvi.wordpress.com/2008/10/26/pictures-at-santa-monica/</link>
		<comments>http://vivekdalvi.wordpress.com/2008/10/26/pictures-at-santa-monica/#comments</comments>
		<pubDate>Sun, 26 Oct 2008 09:33:00 +0000</pubDate>
		<dc:creator>Vivek</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Photos]]></category>

		<guid isPermaLink="false">http://vivekdalvi.wordpress.com/2008/10/26/pictures-at-santa-monica/</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekdalvi.wordpress.com&amp;blog=489653&amp;post=297&amp;subd=vivekdalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008003.jpg"><img title="PDC2008 003" style="display:inline;border-width:0;" height="184" alt="PDC2008 003" src="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008003-thumb.jpg?w=244&#038;h=184" width="244" border="0" /></a> <a href="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008007.jpg"><img title="PDC2008 007" style="display:inline;border-width:0;" height="244" alt="PDC2008 007" src="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008007-thumb.jpg?w=184&#038;h=244" width="184" border="0" /></a> <a href="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008009.jpg"><img title="PDC2008 009" style="display:inline;border-width:0;" height="184" alt="PDC2008 009" src="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008009-thumb.jpg?w=244&#038;h=184" width="244" border="0" /></a> <a href="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008012.jpg"><img title="PDC2008 012" style="display:inline;border-width:0;" height="244" alt="PDC2008 012" src="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008012-thumb.jpg?w=184&#038;h=244" width="184" border="0" /></a> <a href="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008014.jpg"><img title="PDC2008 014" style="display:inline;border-width:0;" height="184" alt="PDC2008 014" src="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008014-thumb.jpg?w=244&#038;h=184" width="244" border="0" /></a> <a href="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008015.jpg"><img title="PDC2008 015" style="display:inline;border-width:0;" height="244" alt="PDC2008 015" src="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008015-thumb.jpg?w=184&#038;h=244" width="184" border="0" /></a> <a href="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008018.jpg"><img title="PDC2008 018" style="display:inline;border-width:0;" height="184" alt="PDC2008 018" src="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008018-thumb.jpg?w=244&#038;h=184" width="244" border="0" /></a> <a href="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008019.jpg"><img title="PDC2008 019" style="display:inline;border-width:0;" height="244" alt="PDC2008 019" src="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008019-thumb.jpg?w=184&#038;h=244" width="184" border="0" /></a> <a href="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008021.jpg"><img title="PDC2008 021" style="display:inline;border-width:0;" height="184" alt="PDC2008 021" src="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008021-thumb.jpg?w=244&#038;h=184" width="244" border="0" /></a> <a href="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008022.jpg"><img title="PDC2008 022" style="display:inline;border-width:0;" height="184" alt="PDC2008 022" src="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008022-thumb.jpg?w=244&#038;h=184" width="244" border="0" /></a> <a href="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008024.jpg"><img title="PDC2008 024" style="display:inline;border-width:0;" height="244" alt="PDC2008 024" src="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008024-thumb.jpg?w=184&#038;h=244" width="184" border="0" /></a> <a href="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008035.jpg"><img title="PDC2008 035" style="display:inline;border-width:0;" height="184" alt="PDC2008 035" src="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008035-thumb.jpg?w=244&#038;h=184" width="244" border="0" /></a> <a href="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008043.jpg"><img title="PDC2008 043" style="display:inline;border-width:0;" height="184" alt="PDC2008 043" src="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008043-thumb.jpg?w=244&#038;h=184" width="244" border="0" /></a> <a href="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008047.jpg"><img title="PDC2008 047" style="display:inline;border-width:0;" height="184" alt="PDC2008 047" src="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008047-thumb.jpg?w=244&#038;h=184" width="244" border="0" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekdalvi.wordpress.com/297/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekdalvi.wordpress.com/297/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekdalvi.wordpress.com/297/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekdalvi.wordpress.com/297/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vivekdalvi.wordpress.com/297/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vivekdalvi.wordpress.com/297/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vivekdalvi.wordpress.com/297/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vivekdalvi.wordpress.com/297/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekdalvi.wordpress.com/297/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekdalvi.wordpress.com/297/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekdalvi.wordpress.com/297/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekdalvi.wordpress.com/297/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekdalvi.wordpress.com/297/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekdalvi.wordpress.com/297/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekdalvi.wordpress.com&amp;blog=489653&amp;post=297&amp;subd=vivekdalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vivekdalvi.wordpress.com/2008/10/26/pictures-at-santa-monica/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/347fa7a1437be365f8a78982e6fe414d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vivekdalvi</media:title>
		</media:content>

		<media:content url="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008003-thumb.jpg" medium="image">
			<media:title type="html">PDC2008 003</media:title>
		</media:content>

		<media:content url="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008007-thumb.jpg" medium="image">
			<media:title type="html">PDC2008 007</media:title>
		</media:content>

		<media:content url="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008009-thumb.jpg" medium="image">
			<media:title type="html">PDC2008 009</media:title>
		</media:content>

		<media:content url="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008012-thumb.jpg" medium="image">
			<media:title type="html">PDC2008 012</media:title>
		</media:content>

		<media:content url="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008014-thumb.jpg" medium="image">
			<media:title type="html">PDC2008 014</media:title>
		</media:content>

		<media:content url="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008015-thumb.jpg" medium="image">
			<media:title type="html">PDC2008 015</media:title>
		</media:content>

		<media:content url="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008018-thumb.jpg" medium="image">
			<media:title type="html">PDC2008 018</media:title>
		</media:content>

		<media:content url="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008019-thumb.jpg" medium="image">
			<media:title type="html">PDC2008 019</media:title>
		</media:content>

		<media:content url="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008021-thumb.jpg" medium="image">
			<media:title type="html">PDC2008 021</media:title>
		</media:content>

		<media:content url="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008022-thumb.jpg" medium="image">
			<media:title type="html">PDC2008 022</media:title>
		</media:content>

		<media:content url="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008024-thumb.jpg" medium="image">
			<media:title type="html">PDC2008 024</media:title>
		</media:content>

		<media:content url="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008035-thumb.jpg" medium="image">
			<media:title type="html">PDC2008 035</media:title>
		</media:content>

		<media:content url="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008043-thumb.jpg" medium="image">
			<media:title type="html">PDC2008 043</media:title>
		</media:content>

		<media:content url="http://vivekdalvipic1.files.wordpress.com/2008/11/pdc2008047-thumb.jpg" medium="image">
			<media:title type="html">PDC2008 047</media:title>
		</media:content>
	</item>
		<item>
		<title>Silverlight 2 RTW&#8230;</title>
		<link>http://vivekdalvi.wordpress.com/2008/10/14/silverlight-2-rtw/</link>
		<comments>http://vivekdalvi.wordpress.com/2008/10/14/silverlight-2-rtw/#comments</comments>
		<pubDate>Tue, 14 Oct 2008 17:44:04 +0000</pubDate>
		<dc:creator>Vivek</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://vivekdalvi.wordpress.com/2008/10/14/silverlight-2-rtw/</guid>
		<description><![CDATA[Today we release Silverlight 2. Whole bunch of people are blogging about whole bunch of features and I don’t think I need to cover it any further. Personally for me, this project has been very special and I thought I would share a picture of myself and Sujal taken during shipping. First picture was taken [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekdalvi.wordpress.com&amp;blog=489653&amp;post=295&amp;subd=vivekdalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today we release <a href="http://silverlight.net/GetStarted/">Silverlight 2</a>. Whole bunch of people are blogging about whole bunch of features and I don’t think I need to cover it any further. Personally for me, this project has been very special and I thought I would share a picture of myself and Sujal taken during shipping.</p>
<ol>
<li>First picture was taken on 10/3/2008 at around 4:00 AM while we were working on a train. This was few days we before locked down.</li>
<li>Second picture was taken after we had locked down for excrow and we both had time to get a haircut.</li>
<li>Third picture was taken yesterday after we shipped!!</li>
</ol>
<p><a href="http://vivekdalvipic1.files.wordpress.com/2008/10/beforeship.jpg"><img style="display:inline;border-width:0;" title="beforeship" src="http://vivekdalvipic1.files.wordpress.com/2008/10/beforeship-thumb.jpg?w=184&#038;h=244" border="0" alt="beforeship" width="184" height="244" /></a> <a href="http://vivekdalvipic1.files.wordpress.com/2008/10/aftership.jpg"><img style="display:inline;border-width:0;" title="aftership" src="http://vivekdalvipic1.files.wordpress.com/2008/10/aftership-thumb.jpg?w=184&#038;h=244" border="0" alt="aftership" width="184" height="244" /></a></p>
<p><a href="http://vivekdalvipic1.files.wordpress.com/2008/10/threeamigos.jpg"><img style="border-right:0;border-top:0;display:inline;border-left:0;border-bottom:0;" title="threeamigos" src="http://vivekdalvipic1.files.wordpress.com/2008/10/threeamigos-thumb.jpg?w=244&#038;h=184" border="0" alt="threeamigos" width="244" height="184" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekdalvi.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekdalvi.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekdalvi.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekdalvi.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vivekdalvi.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vivekdalvi.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vivekdalvi.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vivekdalvi.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekdalvi.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekdalvi.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekdalvi.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekdalvi.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekdalvi.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekdalvi.wordpress.com/295/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekdalvi.wordpress.com&amp;blog=489653&amp;post=295&amp;subd=vivekdalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vivekdalvi.wordpress.com/2008/10/14/silverlight-2-rtw/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/347fa7a1437be365f8a78982e6fe414d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vivekdalvi</media:title>
		</media:content>

		<media:content url="http://vivekdalvipic1.files.wordpress.com/2008/10/beforeship-thumb.jpg" medium="image">
			<media:title type="html">beforeship</media:title>
		</media:content>

		<media:content url="http://vivekdalvipic1.files.wordpress.com/2008/10/aftership-thumb.jpg" medium="image">
			<media:title type="html">aftership</media:title>
		</media:content>

		<media:content url="http://vivekdalvipic1.files.wordpress.com/2008/10/threeamigos-thumb.jpg" medium="image">
			<media:title type="html">threeamigos</media:title>
		</media:content>
	</item>
		<item>
		<title>OnItemsChanged</title>
		<link>http://vivekdalvi.wordpress.com/2008/06/10/onitemschanged/</link>
		<comments>http://vivekdalvi.wordpress.com/2008/06/10/onitemschanged/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 13:17:35 +0000</pubDate>
		<dc:creator>Vivek</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Silverlight; DataBinding]]></category>

		<guid isPermaLink="false">http://vivekdalvi.wordpress.com/2008/06/10/onitemschanged/</guid>
		<description><![CDATA[ItemsControl class in Silverlight Beta2 has added&#160; protected virtual method OnItemsChanged. This method is invoked when Items Property changes. This could be used to add a custom behavior when items are added or removed. Here is the quick sample. I wanted Listbox where when a selected item is removed, it selects the next item in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekdalvi.wordpress.com&amp;blog=489653&amp;post=292&amp;subd=vivekdalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.itemscontrol(VS.95).aspx">ItemsControl</a> class in Silverlight Beta2 has added&#160; protected virtual method <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.itemscontrol.onitemschanged(VS.95).aspx">OnItemsChanged</a>. This method is invoked when <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.itemscontrol.items(VS.95).aspx">Items</a> Property changes. This could be used to add a custom behavior when items are added or removed. Here is the quick sample. </p>
<p>I wanted Listbox where when a selected item is removed, it selects the next item in the list. </p>
<h3>CustomListBox</h3>
<p>&#160;</p>
<div style="border-right:gray 1px solid;border-top:gray 1px solid;font-size:8pt;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;border-bottom:gray 1px solid;font-family:consolas, &#39;background-color:#f4f4f4;margin:20px 0 10px;padding:4px;">
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   1:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> MyListBox: ListBox</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   2:</span>     {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   3:</span>         <span style="color:#0000ff;">protected</span> <span style="color:#0000ff;">override</span> <span style="color:#0000ff;">void</span> OnItemsChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   4:</span>         {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   5:</span>             <span style="color:#0000ff;">base</span>.OnItemsChanged(e);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   6:</span>             <span style="color:#0000ff;">if</span> (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   7:</span>             {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   8:</span>                 <span style="color:#0000ff;">if</span> (e.OldStartingIndex &lt; Items.Count)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   9:</span>                     SelectedItem = Items[e.OldStartingIndex];</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  10:</span>                 <span style="color:#0000ff;">else</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  11:</span>                     SelectedItem = Items[Items.Count - 1];</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  12:</span>             }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  13:</span>         }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  14:</span>     }</pre>
</p></div>
</div>
<p><a href="http://blogs.msdn.com/vivekd/attachment/8589900.ashx">Here</a> is the sample that compares the behavior of default listbox and customlist box. </p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/vivekdalvi.wordpress.com/292/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/vivekdalvi.wordpress.com/292/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekdalvi.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekdalvi.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekdalvi.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekdalvi.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vivekdalvi.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vivekdalvi.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vivekdalvi.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vivekdalvi.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekdalvi.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekdalvi.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekdalvi.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekdalvi.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekdalvi.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekdalvi.wordpress.com/292/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekdalvi.wordpress.com&amp;blog=489653&amp;post=292&amp;subd=vivekdalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vivekdalvi.wordpress.com/2008/06/10/onitemschanged/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/347fa7a1437be365f8a78982e6fe414d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vivekdalvi</media:title>
		</media:content>
	</item>
		<item>
		<title>Beta2 DataBinding</title>
		<link>http://vivekdalvi.wordpress.com/2008/06/10/beta2-databinding/</link>
		<comments>http://vivekdalvi.wordpress.com/2008/06/10/beta2-databinding/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 13:03:12 +0000</pubDate>
		<dc:creator>Vivek</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Silverlight; DataBinding]]></category>

		<guid isPermaLink="false">http://vivekdalvi.wordpress.com/2008/06/10/beta2-databinding/</guid>
		<description><![CDATA[Here is a quick sample to demonstrate some of the new functionality expose in Silverlight Beta2. Validation support: This is exposed as an BindingValidationError event on FrameworkElement and fires when the data source throws an exception. Currently silverlight only support Validation on exception Fallback support for IValueConverter: When ValueConverter comes across a value that can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekdalvi.wordpress.com&amp;blog=489653&amp;post=291&amp;subd=vivekdalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is a quick sample to demonstrate some of the new functionality expose in Silverlight Beta2. </p>
<ol>
<li>Validation support: This is exposed as an <a href="http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.bindingvalidationerror(VS.95).aspx">BindingValidationError</a> event on <a href="http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement(VS.95).aspx">FrameworkElement</a> and fires when the data source throws an exception. Currently silverlight only support Validation on exception
<li>Fallback support for <a href="http://msdn.microsoft.com/en-us/library/system.windows.data.ivalueconverter(VS.95).aspx">IValueConverter</a>: When ValueConverter comes across a value that can not be converted it could return <a href="http://msdn.microsoft.com/en-us/library/system.windows.dependencyproperty.unsetvalue(VS.95).aspx">DependencyProperty.UnsetValue</a> which reverts the target <a href="http://msdn.microsoft.com/en-us/library/system.windows.dependencyproperty(VS.95).aspx">DependencyProperty</a> to default </li>
</ol>
<p>In this sample, there is a simple form that binds data (Person object) to a form that has First Name, Last Name and Age. Age is bound to background of form as well as a TextBox that lets user enter the value for Age. </p>
<ol>
<li>If age is set to be negative then data object throws an exception. This is used to set the background of TextBox to indicate error
<li>Age is also used to set the background color of the form using ValueConverter and background is green if age is greater than 25. If age is less than 25 but not 0 then background is set to be gray. If the age is set to be 0 then value converter returns <a href="http://msdn.microsoft.com/en-us/library/system.windows.dependencyproperty.unsetvalue(VS.95).aspx">DependencyProperty.UnsetValue</a>. </li>
</ol>
<h3>Person</h3>
<p>This is the data source and implements INotifyPropertyChanged to support databinding. </p>
<h4></h4>
<div style="border-right:gray 1px solid;border-top:gray 1px solid;font-size:8pt;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;margin:20px 0 10px;padding:4px;">
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   1:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> Person: INotifyPropertyChanged</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   2:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   3:</span>     <span style="color:#0000ff;">private</span> <span style="color:#0000ff;">string</span> _firstname;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   4:</span>     <span style="color:#0000ff;">private</span> <span style="color:#0000ff;">string</span> _lastname;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   5:</span>     <span style="color:#0000ff;">private</span> <span style="color:#0000ff;">int</span> _age;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   6:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   7:</span>     <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">event</span> PropertyChangedEventHandler PropertyChanged;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   8:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   9:</span>     <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">string</span> FirstName</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  10:</span>     {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  11:</span>         get { <span style="color:#0000ff;">return</span> _firstname; }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  12:</span>         set </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  13:</span>         { </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  14:</span>             _firstname = <span style="color:#0000ff;">value</span>;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  15:</span>             NotifyPropertyChanged(<span style="color:#006080;">"FirstName"</span>);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  16:</span>         }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  17:</span>     }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  18:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  19:</span>     <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">string</span> LastName</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  20:</span>     {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  21:</span>         get { <span style="color:#0000ff;">return</span> _lastname; }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  22:</span>         set </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  23:</span>         { </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  24:</span>             _lastname = <span style="color:#0000ff;">value</span>;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  25:</span>             NotifyPropertyChanged(<span style="color:#006080;">"LastName"</span>);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  26:</span>             </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  27:</span>         }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  28:</span>     }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  29:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  30:</span>     <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">int</span> Age</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  31:</span>     {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  32:</span>         get { <span style="color:#0000ff;">return</span> _age; }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  33:</span>         set </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  34:</span>         {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  35:</span>             <span style="color:#0000ff;">int</span> temp = <span style="color:#0000ff;">value</span>;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  36:</span>             <span style="color:#0000ff;">if</span>(temp &lt; 0)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  37:</span>                <span style="color:#0000ff;">throw</span> <span style="color:#0000ff;">new</span> Exception();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  38:</span>             _age = <span style="color:#0000ff;">value</span>;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  39:</span>             NotifyPropertyChanged(<span style="color:#006080;">"Age"</span>);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  40:</span>         }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  41:</span>     }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  42:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  43:</span>    </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  44:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  45:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  46:</span>     <span style="color:#008000;">//fires Property Change event. </span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  47:</span>     <span style="color:#0000ff;">private</span> <span style="color:#0000ff;">void</span> NotifyPropertyChanged(String info)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  48:</span>     {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  49:</span>         <span style="color:#0000ff;">if</span> (PropertyChanged != <span style="color:#0000ff;">null</span>)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  50:</span>         {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  51:</span>             PropertyChanged(<span style="color:#0000ff;">this</span>, <span style="color:#0000ff;">new</span> PropertyChangedEventArgs(info));</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  52:</span>         }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  53:</span>     }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  54:</span> }</pre>
</div>
</div>
<h3>AgeToColorConverter</h3>
<p>This class implements IValueConverter to convert age to color property</p>
<div style="border-right:gray 1px solid;border-top:gray 1px solid;font-size:8pt;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;margin:20px 0 10px;padding:4px;">
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   1:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> AgeToColorConverter : IValueConverter</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   2:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   3:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   4:</span>     <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">object</span> Convert(<span style="color:#0000ff;">object</span> <span style="color:#0000ff;">value</span>, Type targetType, <span style="color:#0000ff;">object</span> parameter, System.Globalization.CultureInfo culture)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   5:</span>     {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   6:</span>         <span style="color:#0000ff;">if</span> ((<span style="color:#0000ff;">int</span>)<span style="color:#0000ff;">value</span> &gt; 0)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   7:</span>         {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   8:</span>             <span style="color:#0000ff;">if</span> ((<span style="color:#0000ff;">int</span>)<span style="color:#0000ff;">value</span> &gt; 25)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   9:</span>                 <span style="color:#0000ff;">return</span> <span style="color:#0000ff;">new</span> SolidColorBrush(Colors.Green);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  10:</span>             <span style="color:#0000ff;">else</span> </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  11:</span>                 <span style="color:#0000ff;">return</span> <span style="color:#0000ff;">new</span> SolidColorBrush(Colors.Orange);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  12:</span>         }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  13:</span>         <span style="color:#0000ff;">else</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  14:</span>             <span style="color:#0000ff;">return</span> DependencyProperty.UnsetValue;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  15:</span>     }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  16:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  17:</span>     <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">object</span> ConvertBack(<span style="color:#0000ff;">object</span> <span style="color:#0000ff;">value</span>, Type targetType, <span style="color:#0000ff;">object</span> parameter, System.Globalization.CultureInfo culture)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  18:</span>     {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  19:</span>         <span style="color:#0000ff;">return</span> <span style="color:#0000ff;">null</span>;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  20:</span>     }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  21:</span> }</pre>
</div>
</div>
<h3>Page.Xaml</h3>
<div style="border-right:gray 1px solid;border-top:gray 1px solid;font-size:8pt;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;margin:20px 0 10px;padding:4px;">
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   1:</span> <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">UserControl</span> <span style="color:#ff0000;">x:Class</span><span style="color:#0000ff;">="DataBindingBeta2.Page"</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   2:</span>     <span style="color:#ff0000;">xmlns</span><span style="color:#0000ff;">="http://schemas.microsoft.com/winfx/2006/xaml/presentation"</span> </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   3:</span>     <span style="color:#ff0000;">xmlns:x</span><span style="color:#0000ff;">="http://schemas.microsoft.com/winfx/2006/xaml"</span> </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   4:</span>     <span style="color:#ff0000;">xmlns:local</span><span style="color:#0000ff;">="clr-namespace:DataBindingBeta2;assembly=DataBindingBeta2"</span> </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   5:</span>     <span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   6:</span>     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">UserControl.Resources</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   7:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">local:AgeToColorConverter</span> <span style="color:#ff0000;">x:Key</span><span style="color:#0000ff;">="goldconverter"</span><span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   8:</span>     <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">UserControl.Resources</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   9:</span>     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Grid</span> <span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">="LayoutRoot"</span> <span style="color:#ff0000;">Background</span><span style="color:#0000ff;">="{Binding Path=Age, Mode=TwoWay, Converter={StaticResource goldconverter}}"</span> <span style="color:#ff0000;">Height</span><span style="color:#0000ff;">="500"</span> <span style="color:#ff0000;">Width</span><span style="color:#0000ff;">="500"</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  10:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Grid.RowDefinitions</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  11:</span>             <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">RowDefinition</span><span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  12:</span>             <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">RowDefinition</span><span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  13:</span>             <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">RowDefinition</span><span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  14:</span>         <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">Grid.RowDefinitions</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  15:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Grid.ColumnDefinitions</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  16:</span>             <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">ColumnDefinition</span><span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  17:</span>             <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">ColumnDefinition</span><span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  18:</span>         <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">Grid.ColumnDefinitions</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  19:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">TextBlock</span> <span style="color:#ff0000;">Text</span><span style="color:#0000ff;">="First Name"</span> <span style="color:#ff0000;">Grid</span>.<span style="color:#ff0000;">Row</span><span style="color:#0000ff;">="0"</span> <span style="color:#ff0000;">Grid</span>.<span style="color:#ff0000;">Column</span><span style="color:#0000ff;">="0"</span> <span style="color:#ff0000;">VerticalAlignment</span><span style="color:#0000ff;">="Center"</span><span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  20:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">TextBlock</span> <span style="color:#ff0000;">Text</span><span style="color:#0000ff;">="Last Name"</span> <span style="color:#ff0000;">Grid</span>.<span style="color:#ff0000;">Row</span><span style="color:#0000ff;">="1"</span> <span style="color:#ff0000;">Grid</span>.<span style="color:#ff0000;">Column</span><span style="color:#0000ff;">="0"</span> <span style="color:#ff0000;">VerticalAlignment</span><span style="color:#0000ff;">="Center"</span><span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  21:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">TextBlock</span> <span style="color:#ff0000;">Text</span><span style="color:#0000ff;">="Age"</span> <span style="color:#ff0000;">Grid</span>.<span style="color:#ff0000;">Row</span><span style="color:#0000ff;">="2"</span> <span style="color:#ff0000;">Grid</span>.<span style="color:#ff0000;">Column</span><span style="color:#0000ff;">="0"</span> <span style="color:#ff0000;">VerticalAlignment</span><span style="color:#0000ff;">="Center"</span><span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  22:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">TextBox</span> <span style="color:#ff0000;">Grid</span>.<span style="color:#ff0000;">Row</span><span style="color:#0000ff;">="0"</span> <span style="color:#ff0000;">Grid</span>.<span style="color:#ff0000;">Column</span><span style="color:#0000ff;">="1"</span> <span style="color:#ff0000;">VerticalAlignment</span><span style="color:#0000ff;">="Center"</span> <span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">="txtFirstName"</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  23:</span>             <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">TextBox.Text</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  24:</span>                 <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Binding</span> <span style="color:#ff0000;">Mode</span><span style="color:#0000ff;">="TwoWay"</span> <span style="color:#ff0000;">Path</span><span style="color:#0000ff;">="FirstName"</span><span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  25:</span>             <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">TextBox.Text</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  26:</span>         <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">TextBox</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  27:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">TextBox</span> <span style="color:#ff0000;">Grid</span>.<span style="color:#ff0000;">Row</span><span style="color:#0000ff;">="1"</span> <span style="color:#ff0000;">Grid</span>.<span style="color:#ff0000;">Column</span><span style="color:#0000ff;">="1"</span> <span style="color:#ff0000;">VerticalAlignment</span><span style="color:#0000ff;">="Center"</span> <span style="color:#ff0000;">Text</span><span style="color:#0000ff;">="{Binding Path=LastName, Mode=TwoWay}"</span> <span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">="txtLastName"</span><span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  28:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">TextBox</span> <span style="color:#ff0000;">Grid</span>.<span style="color:#ff0000;">Row</span><span style="color:#0000ff;">="2"</span> <span style="color:#ff0000;">Grid</span>.<span style="color:#ff0000;">Column</span><span style="color:#0000ff;">="1"</span> <span style="color:#ff0000;">VerticalAlignment</span><span style="color:#0000ff;">="Center"</span> <span style="color:#ff0000;">Text</span><span style="color:#0000ff;">="{Binding Path=Age, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}"</span> <span style="color:#ff0000;">BindingValidationError</span><span style="color:#0000ff;">="TextBox_BindingValidationError"</span> <span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">="txtAge"</span> <span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  29:</span>     <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">Grid</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  30:</span> <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">UserControl</span><span style="color:#0000ff;">&gt;</span></pre>
</div>
</div>
<p>Interesting parts of this XAML is</p>
<pre>&lt;TextBox Grid.Row="2" Grid.Column="1" VerticalAlignment="Center" x:Name="txtAge" </pre>
<pre>Text="{Binding Path=Age, Mode=TwoWay, ValidatesOnExceptions=true, </pre>
<pre>NotifyOnValidationError=true}" BindingValidationError="TextBox_BindingValidationError" /&gt;</pre>
<pre>&nbsp;</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<h3>Page.Xaml.cs</h3>
<div style="border-right:gray 1px solid;border-top:gray 1px solid;font-size:8pt;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;margin:20px 0 10px;padding:4px;">
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   1:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">partial</span> <span style="color:#0000ff;">class</span> Page : UserControl</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   2:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   3:</span>     <span style="color:#0000ff;">public</span> Page()</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   4:</span>     {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   5:</span>         InitializeComponent();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   6:</span>         Person p = <span style="color:#0000ff;">new</span> Person();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   7:</span>         p.FirstName = <span style="color:#006080;">"Vivek"</span>;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   8:</span>         p.LastName = <span style="color:#006080;">"Dalvi"</span>;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   9:</span>         p.Age = 100;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  10:</span>         DataContext = p;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  11:</span>     }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  12:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  13:</span>    </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  14:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  15:</span>     </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  16:</span>     <span style="color:#0000ff;">private</span> <span style="color:#0000ff;">void</span> TextBox_BindingValidationError(<span style="color:#0000ff;">object</span> sender, ValidationErrorEventArgs e)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  17:</span>     {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  18:</span>         <span style="color:#0000ff;">if</span> (e.Action == ValidationErrorEventAction.Added)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  19:</span>         {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  20:</span>             TextBox t = sender <span style="color:#0000ff;">as</span> TextBox;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  21:</span>             t.Background = <span style="color:#0000ff;">new</span> SolidColorBrush(Colors.Red);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  22:</span>         }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  23:</span>         <span style="color:#0000ff;">if</span> (e.Action == ValidationErrorEventAction.Removed)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  24:</span>         {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  25:</span>             TextBox t = sender <span style="color:#0000ff;">as</span> TextBox;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  26:</span>             t.Background = <span style="color:#0000ff;">new</span> SolidColorBrush(Colors.White);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  27:</span>         }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  28:</span>     }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  29:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  30:</span>    </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  31:</span> }</pre>
</div>
</div>
</p>
</p>
</p>
</p>
</p>
<p><a href="http://blogs.msdn.com/vivekd/attachment/8589888.ashx">Here</a> is the sample project.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/vivekdalvi.wordpress.com/291/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/vivekdalvi.wordpress.com/291/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekdalvi.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekdalvi.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekdalvi.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekdalvi.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vivekdalvi.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vivekdalvi.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vivekdalvi.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vivekdalvi.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekdalvi.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekdalvi.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekdalvi.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekdalvi.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekdalvi.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekdalvi.wordpress.com/291/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekdalvi.wordpress.com&amp;blog=489653&amp;post=291&amp;subd=vivekdalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vivekdalvi.wordpress.com/2008/06/10/beta2-databinding/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/347fa7a1437be365f8a78982e6fe414d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vivekdalvi</media:title>
		</media:content>
	</item>
		<item>
		<title>Vihan&#8217;s Dream</title>
		<link>http://vivekdalvi.wordpress.com/2008/05/05/vihans-dream/</link>
		<comments>http://vivekdalvi.wordpress.com/2008/05/05/vihans-dream/#comments</comments>
		<pubDate>Mon, 05 May 2008 08:24:55 +0000</pubDate>
		<dc:creator>Vivek</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Poems]]></category>

		<guid isPermaLink="false">http://vivekdalvi.wordpress.com/2008/05/05/vihans-dream/</guid>
		<description><![CDATA[Tonight I woke up In my son’s dreamMy nose was running, but I felt clean Roof of sky and hugs of kinBears to play and dolphins to swim Eyes were bright, no clouds of grimFuture was flowing in bubbly stream Faces were full of smiles and grinLocked were steps and up was chin Had heart [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekdalvi.wordpress.com&amp;blog=489653&amp;post=290&amp;subd=vivekdalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Tonight I woke up In my son’s dream<br />My nose was running, but I felt clean
<p>Roof of sky and hugs of kin<br />Bears to play and dolphins to swim
<p>Eyes were bright, no clouds of grim<br />Future was flowing in bubbly stream
<p>Faces were full of smiles and grin<br />Locked were steps and up was chin
<p>Had heart of gold, no strains of mean<br />No hurry to win and no rush to sin
<p>Everything was perfect, everything was sane<br />There was yang in balance with yin</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/vivekdalvi.wordpress.com/290/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/vivekdalvi.wordpress.com/290/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekdalvi.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekdalvi.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekdalvi.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekdalvi.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vivekdalvi.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vivekdalvi.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vivekdalvi.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vivekdalvi.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekdalvi.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekdalvi.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekdalvi.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekdalvi.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekdalvi.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekdalvi.wordpress.com/290/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekdalvi.wordpress.com&amp;blog=489653&amp;post=290&amp;subd=vivekdalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vivekdalvi.wordpress.com/2008/05/05/vihans-dream/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/347fa7a1437be365f8a78982e6fe414d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vivekdalvi</media:title>
		</media:content>
	</item>
		<item>
		<title>All Search Application Posts So Far&#8230;</title>
		<link>http://vivekdalvi.wordpress.com/2008/04/25/all-search-application-posts-so-far/</link>
		<comments>http://vivekdalvi.wordpress.com/2008/04/25/all-search-application-posts-so-far/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 13:54:17 +0000</pubDate>
		<dc:creator>Vivek</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Live]]></category>
		<category><![CDATA[Search]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://vivekdalvi.wordpress.com/2008/04/25/all-search-application-posts-so-far/</guid>
		<description><![CDATA[Wanted to consolidate all search application posts so far Technorati Tags: Silverlight,Search http://vivekdalvi.wordpress.com/2008/03/28/part-1-live-search-using-silverlight-main-page/ http://vivekdalvi.wordpress.com/2008/03/29/part-2-live-search-using-silverlight-live-search-call-and-progress/ http://vivekdalvi.wordpress.com/2008/03/30/part-3-image-search-result-view/ http://vivekdalvi.wordpress.com/2008/04/06/part-4-image-detail-view/ http://vivekdalvi.wordpress.com/2008/04/15/part-5-better-image-detail-view/ http://vivekdalvi.wordpress.com/2008/04/21/part-6-slider-for-tile-size/ http://vivekdalvi.wordpress.com/2008/04/22/part-7-web-search-results/ http://vivekdalvi.wordpress.com/2008/04/24/part-8-3d-image-view-using-custom-layout/ http://vivekdalvi.wordpress.com/2008/04/25/part-9-image-size-filter/<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekdalvi.wordpress.com&amp;blog=489653&amp;post=289&amp;subd=vivekdalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p> Wanted to consolidate all search application posts so far</p>
<div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:5a19d428-3262-457c-9488-260374cde33f" style="display:inline;margin:0;padding:0;">Technorati Tags: <a href="http://technorati.com/tags/Silverlight" rel="tag">Silverlight</a>,<a href="http://technorati.com/tags/Search" rel="tag">Search</a></div>
<p><a href="http://vivekdalvi.wordpress.com/2008/03/28/part-1-live-search-using-silverlight-main-page/">http://vivekdalvi.wordpress.com/2008/03/28/part-1-live-search-using-silverlight-main-page/</a></p>
<p><a href="http://vivekdalvi.wordpress.com/2008/03/29/part-2-live-search-using-silverlight-live-search-call-and-progress/">http://vivekdalvi.wordpress.com/2008/03/29/part-2-live-search-using-silverlight-live-search-call-and-progress/</a></p>
<p><a href="http://vivekdalvi.wordpress.com/2008/03/30/part-3-image-search-result-view/">http://vivekdalvi.wordpress.com/2008/03/30/part-3-image-search-result-view/</a></p>
<p><a href="http://vivekdalvi.wordpress.com/2008/04/06/part-4-image-detail-view/">http://vivekdalvi.wordpress.com/2008/04/06/part-4-image-detail-view/</a></p>
<p><a href="http://vivekdalvi.wordpress.com/2008/04/15/part-5-better-image-detail-view/">http://vivekdalvi.wordpress.com/2008/04/15/part-5-better-image-detail-view/</a></p>
<p><a href="http://vivekdalvi.wordpress.com/2008/04/21/part-6-slider-for-tile-size/">http://vivekdalvi.wordpress.com/2008/04/21/part-6-slider-for-tile-size/</a></p>
<p><u><a href="http://vivekdalvi.wordpress.com/2008/04/22/part-7-web-search-results/">http://vivekdalvi.wordpress.com/2008/04/22/part-7-web-search-results/</a></u><a href="http://vivekdalvi.wordpress.com/"></a></p>
<p><a href="http://vivekdalvi.wordpress.com/2008/04/24/part-8-3d-image-view-using-custom-layout/">http://vivekdalvi.wordpress.com/2008/04/24/part-8-3d-image-view-using-custom-layout/</a></p>
<p><a href="http://vivekdalvi.wordpress.com/2008/04/25/part-9-image-size-filter/">http://vivekdalvi.wordpress.com/2008/04/25/part-9-image-size-filter/</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/vivekdalvi.wordpress.com/289/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/vivekdalvi.wordpress.com/289/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekdalvi.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekdalvi.wordpress.com/289/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekdalvi.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekdalvi.wordpress.com/289/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vivekdalvi.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vivekdalvi.wordpress.com/289/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vivekdalvi.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vivekdalvi.wordpress.com/289/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekdalvi.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekdalvi.wordpress.com/289/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekdalvi.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekdalvi.wordpress.com/289/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekdalvi.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekdalvi.wordpress.com/289/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekdalvi.wordpress.com&amp;blog=489653&amp;post=289&amp;subd=vivekdalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vivekdalvi.wordpress.com/2008/04/25/all-search-application-posts-so-far/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/347fa7a1437be365f8a78982e6fe414d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vivekdalvi</media:title>
		</media:content>
	</item>
		<item>
		<title>Part 9: Image Size Filter</title>
		<link>http://vivekdalvi.wordpress.com/2008/04/25/part-9-image-size-filter/</link>
		<comments>http://vivekdalvi.wordpress.com/2008/04/25/part-9-image-size-filter/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 11:40:46 +0000</pubDate>
		<dc:creator>Vivek</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[DataBinding]]></category>
		<category><![CDATA[Live]]></category>
		<category><![CDATA[Search]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://vivekdalvi.wordpress.com/2008/04/25/part-9-image-size-filter/</guid>
		<description><![CDATA[This part adds a filtering images out of view using size as the basis. So If user wants to see images bigger than certain size, he could use the slider to do it. This means I needed to convert size into opacity so if the size of image was less than what was set in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekdalvi.wordpress.com&amp;blog=489653&amp;post=288&amp;subd=vivekdalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This part adds a filtering images out of view using size as the basis. So If user wants to see images bigger than certain size, he could use the slider to do it. This means I needed to convert size into opacity so if the size of image was less than what was set in the slider then I needed to set the opacity of the image. Here is how it looks like when it is running</p>
<p><a href="http://vivekdalvipic1.files.wordpress.com/2008/04/imagesizefilter.jpg"><img style="border-width:0;" src="http://vivekdalvipic1.files.wordpress.com/2008/04/imagesizefilter-thumb.jpg?w=244&#038;h=196" border="0" alt="imagesizefilter" width="244" height="196" /></a></p>
<p>To get to this point, I need to build an IValueConverter implementation that converts size into opacity, which was pretty straight forward.</p>
<h3>SizeToOpacityConverter.cs</h3>
<div style="border-right:gray 1px solid;border-top:gray 1px solid;font-size:8pt;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;margin:20px 0 10px;padding:4px;">
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   1:</span> <span style="color:#0000ff;">using</span> System;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   2:</span> <span style="color:#0000ff;">using</span> System.Windows.Data;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   3:</span> </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   4:</span> <span style="color:#0000ff;">namespace</span> Search</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   5:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   6:</span>     <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> SizeToOpacityConverter : IValueConverter</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   7:</span>     {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   8:</span>         <span style="color:#cc6633;">#region</span> Public Members</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   9:</span> </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  10:</span>         <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">object</span> Convert(<span style="color:#0000ff;">object</span> <span style="color:#0000ff;">value</span>, Type targetType, <span style="color:#0000ff;">object</span> parameter, System.Globalization.CultureInfo culture)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  11:</span>         {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  12:</span>             Tile tile = (Tile)parameter;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  13:</span>             <span style="color:#0000ff;">int</span> imagesize = (<span style="color:#0000ff;">int</span>)<span style="color:#0000ff;">value</span>/1000;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  14:</span>             <span style="color:#0000ff;">if</span> (tile.FilterSize &lt; imagesize)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  15:</span>                 <span style="color:#0000ff;">return</span> 1;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  16:</span>             <span style="color:#0000ff;">else</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  17:</span>                 <span style="color:#0000ff;">return</span> 0.2;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  18:</span>         }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  19:</span> </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  20:</span>         <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">object</span> ConvertBack(<span style="color:#0000ff;">object</span> <span style="color:#0000ff;">value</span>, Type targetType, <span style="color:#0000ff;">object</span> parameter, System.Globalization.CultureInfo culture)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  21:</span>         {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  22:</span>             <span style="color:#0000ff;">return</span> <span style="color:#0000ff;">null</span>;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  23:</span>         }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  24:</span>         <span style="color:#cc6633;">#endregion</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  25:</span>     }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  26:</span> }</pre>
</div>
</div>
<h3>ImageGridView.Xaml</h3>
<div style="border-right:gray 1px solid;border-top:gray 1px solid;font-size:8pt;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;margin:20px 0 10px;padding:4px;">
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   1:</span> <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">UserControl</span> <span style="color:#ff0000;">x:Class</span><span style="color:#0000ff;">="Search.Image3DView"</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   2:</span>     <span style="color:#ff0000;">xmlns</span><span style="color:#0000ff;">="http://schemas.microsoft.com/client/2007"</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   3:</span>     <span style="color:#ff0000;">xmlns:x</span><span style="color:#0000ff;">="http://schemas.microsoft.com/winfx/2006/xaml"</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   4:</span>     <span style="color:#ff0000;">xmlns:local</span><span style="color:#0000ff;">="clr-namespace:Search;assembly=Search"</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   5:</span>     <span style="color:#ff0000;">xmlns:control</span><span style="color:#0000ff;">="clr-namespace:MyControls;assembly=MyControls"</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   6:</span>     <span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   7:</span>     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">UserControl.Resources</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   8:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">local:ImageSourceConverter</span> <span style="color:#ff0000;">x:Key</span><span style="color:#0000ff;">="imagesourceconverter"</span><span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   9:</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  10:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">local:Tile</span> <span style="color:#ff0000;">x:Key</span><span style="color:#0000ff;">="TileInfo"</span><span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  11:</span>     <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">UserControl.Resources</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  12:</span>     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">ItemsControl</span> <span style="color:#ff0000;">ItemsSource</span><span style="color:#0000ff;">="{Binding}"</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  13:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">ItemsControl.ItemsPanel</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  14:</span>             <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">ItemsPanelTemplate</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  15:</span>                 <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">control:Stack3DPanel</span> <span style="color:#ff0000;">FrameCount</span><span style="color:#0000ff;">="5"</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  16:</span>                                       <span style="color:#ff0000;">MouseLeftButtonDown</span><span style="color:#0000ff;">="Stack3DPanel_MouseLeftButtonDown"</span><span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  17:</span>             <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">ItemsPanelTemplate</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  18:</span>         <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">ItemsControl.ItemsPanel</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  19:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">ItemsControl.ItemTemplate</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  20:</span>             <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">DataTemplate</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  21:</span>                 <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Border</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  22:</span>                     <span style="color:#ff0000;">BorderThickness</span><span style="color:#0000ff;">="2,2,2,2"</span> <span style="color:#ff0000;">BorderBrush</span><span style="color:#0000ff;">="#FF313131"</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  23:</span>                     <span style="color:#ff0000;">CornerRadius</span><span style="color:#0000ff;">="5,5,5,5"</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  24:</span>                     <span style="color:#ff0000;">MouseEnter</span><span style="color:#0000ff;">="Border_MouseEnter"</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  25:</span>                     <span style="color:#ff0000;">MouseLeave</span><span style="color:#0000ff;">="Border_MouseLeave"</span> <span style="color:#ff0000;">Background</span><span style="color:#0000ff;">="White"</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  26:</span>                     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Border.RenderTransform</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  27:</span>                         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">TransformGroup</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  28:</span>                             <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">ScaleTransform</span> <span style="color:#ff0000;">ScaleX</span><span style="color:#0000ff;">="1"</span> <span style="color:#ff0000;">ScaleY</span><span style="color:#0000ff;">="1"</span><span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  29:</span>                             <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">SkewTransform</span> <span style="color:#ff0000;">AngleX</span><span style="color:#0000ff;">="0"</span> <span style="color:#ff0000;">AngleY</span><span style="color:#0000ff;">="0"</span><span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  30:</span>                             <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">RotateTransform</span> <span style="color:#ff0000;">Angle</span><span style="color:#0000ff;">="0"</span><span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  31:</span>                             <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">TranslateTransform</span> <span style="color:#ff0000;">X</span><span style="color:#0000ff;">="0"</span> <span style="color:#ff0000;">Y</span><span style="color:#0000ff;">="0"</span><span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  32:</span>                         <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">TransformGroup</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  33:</span>                     <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">Border.RenderTransform</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  34:</span>                     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Image</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  35:</span>                         <span style="color:#ff0000;">Margin</span><span style="color:#0000ff;">="5,5,5,5"</span>  <span style="color:#ff0000;">Stretch</span><span style="color:#0000ff;">="Uniform"</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  36:</span>                         <span style="color:#ff0000;">Source</span><span style="color:#0000ff;">="{Binding Image.ImageURL , Converter={StaticResource imagesourceconverter}}"</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  37:</span>                         <span style="color:#ff0000;">RenderTransformOrigin</span><span style="color:#0000ff;">="0.5,0.5"</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  38:</span>                         <span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">="image"</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  39:</span>                         <span style="color:#ff0000;">HorizontalAlignment</span><span style="color:#0000ff;">="Stretch"</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  40:</span>                         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Image.RenderTransform</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  41:</span>                             <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">TransformGroup</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  42:</span>                                 <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">ScaleTransform</span><span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  43:</span>                                 <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">SkewTransform</span><span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  44:</span>                                 <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">RotateTransform</span><span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  45:</span>                                 <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">TranslateTransform</span><span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  46:</span>                             <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">TransformGroup</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  47:</span>                         <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">Image.RenderTransform</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  48:</span>                     <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">Image</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  49:</span>                 <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">Border</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  50:</span>             <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">DataTemplate</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  51:</span>         <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">ItemsControl.ItemTemplate</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  52:</span>     <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">ItemsControl</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  53:</span> <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">UserControl</span><span style="color:#0000ff;">&gt;</span></pre>
</div>
</div>
<p>Second part was the bind the opacity of images with filesize and use above SizeToOpeacityConverter. Interesting part of this xaml is</p>
<pre><span style="color:#0000ff;">&lt;</span><span style="color:#a31515;">Image
   </span><span style="color:#ff0000;">Source</span><span style="color:#0000ff;">="{</span><span style="color:#a31515;">Binding </span><span style="color:#ff0000;">Image</span><span style="color:#0000ff;">.</span><span style="color:#ff0000;">ThumbnailURL</span><span style="color:#0000ff;">, </span><span style="color:#ff0000;">Converter</span><span style="color:#0000ff;">={</span><span style="color:#a31515;">StaticResource </span><span style="color:#ff0000;">imagesourceconverter</span><span style="color:#0000ff;">}}"
   </span><span style="color:#ff0000;">Opacity</span><span style="color:#0000ff;">="{</span><span style="color:#a31515;">Binding </span><span style="color:#ff0000;">Image</span><span style="color:#0000ff;">.</span><span style="color:#ff0000;">ImageFileSize </span><span style="color:#0000ff;">,
</span><span style="color:#ff0000;">Converter</span><span style="color:#0000ff;">={</span><span style="color:#a31515;">StaticResource </span><span style="color:#ff0000;">sizetoopacityconverter</span><span style="color:#0000ff;">},
</span><span style="color:#ff0000;">ConverterParameter</span><span style="color:#0000ff;">={</span><span style="color:#a31515;">StaticResource </span><span style="color:#ff0000;">TileInfo</span><span style="color:#0000ff;">}}"
   </span><span style="color:#ff0000;">ImageFailed</span><span style="color:#0000ff;">="Image_ImageFailed"
   </span><span style="color:#ff0000;">Cursor</span><span style="color:#0000ff;">="Hand"
   </span><span style="color:#ff0000;">Margin</span><span style="color:#0000ff;">="1,1,1,1"/&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Then I hit this problem, which I ended up solving but I am not sure if this is the best way to solve it. If I find it, i will post again later. The problem is that thing that updates in above code is ConverterParameter for the Binding and When parameter changes, I could figure out a way to update a single binding. So I ended up writing this code which actually performance wise was good enough for me but that just seems like a wrong way to do it..</p>
<h3>Page.xaml.cs</h3>
<p><span style="color:#0000ff;">private void</span>sizeslider_ValueChanged(<span style="color:#0000ff;">object</span>sender, <span style="color:#2b91af;">RoutedPropertyChangedEventArgs</span>&lt;<span style="color:#0000ff;">double</span>&gt; e)<br />
{<br />
    <span style="color:#0000ff;">string</span>s = e.NewValue.ToString();<br />
    txtvalue.Text = <span style="color:#a31515;">&#8220;&gt; &#8221; </span>+ s.Split(<span style="color:#0000ff;">new char</span>[]{<span style="color:#a31515;">&#8216;.&#8217;</span>})[0] + <span style="color:#a31515;">&#8221; (KB)&#8221;</span>;<br />
    imageGrid.FilterSize = e.NewValue;<br />
    imageGrid.DataContext = <span style="color:#0000ff;">null</span>;<br />
    imageGrid.DataContext = _searchresultcollectioncollection;<br />
}</p>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>This basically resets the datacontext and hence all bindings are recomputed.</p>
<p><a href="http://blogs.msdn.com/vivekd/attachment/8423912.ashx">Here</a> is the copy of working project.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/vivekdalvi.wordpress.com/288/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/vivekdalvi.wordpress.com/288/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekdalvi.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekdalvi.wordpress.com/288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekdalvi.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekdalvi.wordpress.com/288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vivekdalvi.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vivekdalvi.wordpress.com/288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vivekdalvi.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vivekdalvi.wordpress.com/288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekdalvi.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekdalvi.wordpress.com/288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekdalvi.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekdalvi.wordpress.com/288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekdalvi.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekdalvi.wordpress.com/288/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekdalvi.wordpress.com&amp;blog=489653&amp;post=288&amp;subd=vivekdalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vivekdalvi.wordpress.com/2008/04/25/part-9-image-size-filter/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/347fa7a1437be365f8a78982e6fe414d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vivekdalvi</media:title>
		</media:content>

		<media:content url="http://vivekdalvipic1.files.wordpress.com/2008/04/imagesizefilter-thumb.jpg" medium="image">
			<media:title type="html">imagesizefilter</media:title>
		</media:content>
	</item>
	</channel>
</rss>
