<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-7209751425484679379</atom:id><lastBuildDate>Fri, 08 Nov 2024 15:22:09 +0000</lastBuildDate><category>.NET</category><category>ASP.NET</category><category>ASP.NET 2.0</category><category>Microsoft Surface</category><category>WPF</category><category>LINQ</category><category>Silverlight</category><category>JavaScript</category><category>Ajax</category><category>Identitymine</category><category>XML</category><category>WCF</category><category>C#</category><category>SQL</category><category>Blogger</category><category>CSS</category><category>CodeProject</category><category>HTML</category><category>Microsoft</category><category>Programming</category><category>SEO</category><category>Sharepoint</category><category>Visual Studio 2010</category><title>Code.NET</title><description></description><link>http://codepronet.blogspot.com/</link><managingEditor>noreply@blogger.com (Unknown)</managingEditor><generator>Blogger</generator><openSearch:totalResults>58</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7209751425484679379.post-7147499291303774788</guid><pubDate>Thu, 01 Jul 2010 03:30:00 +0000</pubDate><atom:updated>2010-07-01T10:39:43.830+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Blogger</category><category domain="http://www.blogger.com/atom/ns#">HTML</category><category domain="http://www.blogger.com/atom/ns#">SEO</category><title>SEO Tip - Dynamic Meta Tag for Blogger</title><description>Search Engine Optimization is necessary to bring traffic to a website. Meta tag is one of the  element that Search engines use while crawling as according to some SEO guides and most important is Description meta tag. So I spent some time to add Description meta tag to my blog which is powered by Blogger. After that I realized that we can only add static meta tag through out the whole blog in normal way by using edit HTML template. As per SEO guides, adding same meta tag through out the blog is not a good practice and we should avoid the same. Some workarounds are there for adding dynamic description meta tag for blogger by checking some conditions. But for achieving that we need to add condition for each and every post. So I tried some alternatives and I believe I got a nice workaround.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Go to Edit HTML template page of Blogger.&lt;/li&gt;
&lt;li&gt;I added page title itself as meta content. Paste the below code in the head section,&lt;br /&gt;
&lt;span style=&quot;color: #990000;&quot;&gt;&amp;lt;meta expr:content=&#39;data:blog.pageTitle&#39; name=&#39;keywords&#39;/&amp;gt;&lt;/span&gt;&lt;br style=&quot;color: #990000;&quot; /&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;lt;meta expr:content=&#39;data:blog.pageTitle&#39; name=&#39;Description&#39;/&amp;gt;&lt;/span&gt;&lt;br style=&quot;color: #990000;&quot; /&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;lt;meta expr:content=&#39;data:blog.pageTitle&#39; name=&#39;Subject&#39;/&amp;gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;This will add the page title as the meta content which is far better than adding same static content for the entire blog.&lt;br /&gt;
Happy blogging.</description><link>http://codepronet.blogspot.com/2010/06/seo-tip-dynamic-meta-tag-for-blogger.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7209751425484679379.post-2795665334244355443</guid><pubDate>Thu, 10 Jun 2010 04:47:00 +0000</pubDate><atom:updated>2010-07-02T10:20:21.226+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">CodeProject</category><title>CodeProject Monthly Competition</title><description>Yesterday I saw that my latest article is listed for Voting under the section Best ASP.NET Article of May 2010. Its a beginner article about a simple Silverlight RSS Reader and I am happy to see that it helped some beginners.&lt;br /&gt;
&lt;br /&gt;
If you like the article and think that it&#39;ll help some beginners then Vote for it.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.codeproject.com/script/Surveys/VoteForm.aspx?srvid=1045&quot; target=&quot;__blank&quot;&gt;http://www.codeproject.com/script/Surveys/VoteForm.aspx?srvid=1045&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Thanks for your time.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;[UPDATE]&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;status-body&quot;&gt;&lt;span class=&quot;status-content&quot;&gt;&lt;span class=&quot;entry-content&quot;&gt;Article won the CodeProject&#39;s monthly competition  for Best ASP.NET Article of May 2010.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;status-body&quot;&gt;&lt;span class=&quot;status-content&quot;&gt;&lt;span class=&quot;entry-content&quot;&gt;Thanks to you all for supporting  me.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;</description><link>http://codepronet.blogspot.com/2010/06/codeproject-monthly-competition.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7209751425484679379.post-2679286302197594340</guid><pubDate>Wed, 26 May 2010 12:42:00 +0000</pubDate><atom:updated>2010-06-30T11:02:36.475+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">LINQ</category><category domain="http://www.blogger.com/atom/ns#">Silverlight</category><category domain="http://www.blogger.com/atom/ns#">WCF</category><category domain="http://www.blogger.com/atom/ns#">XML</category><title>A Silverlight RSS Reader</title><description>&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNIgORM6gM2ijq_aRWFBVhQqe60JqdedpXydztwpTAevGuWU5DebMjMh2ilyIkKSz0gsy_5pWVUz-YzbswYA3M7_LDQGhTnzAXKscm23uD5P4Hget8wNLNL9BWxGYbnkldF3Y4YheDWYU/s1600-h/Capture%5B4%5D.png&quot;&gt;&lt;img alt=&quot;A Silverlight RSS Reader&quot; border=&quot;0&quot; height=&quot;266&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEb4EWHjifujljuBbMfi89I_xoPN8swog2DcSD2Vjziypm7xjrVyVZw1yIRro97b7m2zdNI6wZTyMTAzsTPrMRKsO5ZiistUE4hUku4UNp__21FiPlowsb4t2G21Z76zLVckqON4bNEJU/?imgmax=800&quot; style=&quot;border: 0px none; display: inline;&quot; title=&quot;Silverlight RSS Reader Screenshot&quot; width=&quot;504&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;This article shows how to create a simple RSS Reader in silverlight.We can start creating a silverlight application from the Visual studio templates and it&#39;ll automatically create a silverlight project and a Web application into which silverlight is hosted.We need to fetch data from the feed url that a user is entered and for that purpose, we are going to use a WCF service so that the silverlight client can make asynchronous calls and can fetch the response.So Lets start by adding a WCF service to the Web application, here in my sample its RSSReaderService.svc.If we add WCF service directly to the Web application instead of creating a new service project, then the service will be hosted in the web application itself when we start the application. I&amp;nbsp; created a ServiceContract IRSSReaderService and added an OperationContract GetFeed(string uri), a method which defines an operation for the service contract.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;border: 1px solid; overflow: auto; width: 530px;&quot;&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;namespace &lt;/span&gt;RSSReader.Web
{
  [&lt;span style=&quot;color: #2b91af;&quot;&gt;ServiceContract&lt;/span&gt;]
&lt;span style=&quot;color: blue;&quot;&gt;  public interface &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;IRSSReaderService
&lt;/span&gt;  {
    [&lt;span style=&quot;color: #2b91af;&quot;&gt;OperationContract&lt;/span&gt;]
&lt;span style=&quot;color: #2b91af;&quot;&gt;    IEnumerable&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;RSSItem&lt;/span&gt;&amp;gt; GetFeed(&lt;span style=&quot;color: blue;&quot;&gt;string &lt;/span&gt;uri);
  }
}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;We need to implement the operation contract GetFeed(string uri) in our service code behind which is implementing IRSSReaderService.We are using&amp;nbsp; System.ServiceModel.Syndication, a namespace using for Syndication object model, for loading the syndication feed from the XmlReader instantiated with the specified feed url. For sending the properties from the feed to the client we created a DataContract RSSItem with DataMembers like Title,Summary,PublishDate and Permalink. We can customize the data members according to our requirement but here i am simply using these much information to send to the client.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;border: 1px solid; overflow: auto; width: 530px;&quot;&gt;&lt;pre class=&quot;code&quot;&gt;[&lt;span style=&quot;color: #2b91af;&quot;&gt;DataContract&lt;/span&gt;]
&lt;span style=&quot;color: blue;&quot;&gt;public class &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;RSSItem
&lt;/span&gt;{
  [&lt;span style=&quot;color: #2b91af;&quot;&gt;DataMember&lt;/span&gt;]
&lt;span style=&quot;color: blue;&quot;&gt;  public string &lt;/span&gt;Title { &lt;span style=&quot;color: blue;&quot;&gt;get&lt;/span&gt;; &lt;span style=&quot;color: blue;&quot;&gt;set&lt;/span&gt;; }&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;After creating this DataContract we create an XmlReader with the specified url and load the SyndicationFeed items from this XMLReader. Now we can use LINQ for iterating through this syndication items and for fetching the required information from those items.We are populating the RSSItem that we created and sending an IEnumerable of this object from the service to the client.So our GetFeed(string url) method implementation looks like,&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;border: 1px solid; overflow: auto; width: 530px;&quot;&gt;&lt;pre class=&quot;code&quot;&gt;[&lt;span style=&quot;color: #2b91af;&quot;&gt;AspNetCompatibilityRequirements&lt;/span&gt;(RequirementsMode = &lt;span style=&quot;color: #2b91af;&quot;&gt;AspNetCompatibilityRequirementsMode&lt;/span&gt;.Allowed)]
&lt;span style=&quot;color: blue;&quot;&gt;public class &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;RSSReaderService &lt;/span&gt;: &lt;span style=&quot;color: #2b91af;&quot;&gt;IRSSReaderService
&lt;/span&gt;{

&lt;span style=&quot;color: blue;&quot;&gt;  public &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;RSSItem&lt;/span&gt;&amp;gt; GetFeed(&lt;span style=&quot;color: blue;&quot;&gt;string &lt;/span&gt;uri)
  {
&lt;span style=&quot;color: #2b91af;&quot;&gt;    XmlReader &lt;/span&gt;reader = &lt;span style=&quot;color: #2b91af;&quot;&gt;XmlReader&lt;/span&gt;.Create(uri);
&lt;span style=&quot;color: #2b91af;&quot;&gt;    SyndicationFeed &lt;/span&gt;rssFeed = &lt;span style=&quot;color: #2b91af;&quot;&gt;SyndicationFeed&lt;/span&gt;.Load(reader);

&lt;span style=&quot;color: blue;&quot;&gt;    var &lt;/span&gt;items = &lt;span style=&quot;color: blue;&quot;&gt;from &lt;/span&gt;p &lt;span style=&quot;color: blue;&quot;&gt;in &lt;/span&gt;rssFeed.Items
&lt;span style=&quot;color: blue;&quot;&gt;                select new &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;RSSItem
&lt;/span&gt;                {
                   Title = p.Title.Text,
                   Summary = p.Summary.Text.Trim(),
                   Permalink = (p.Links.FirstOrDefault() != &lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;) ? p.Links.FirstOrDefault().GetAbsoluteUri() : &lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;,
                   PublishDate = p.PublishDate.LocalDateTime.ToString(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;dd/MMM/yyyy&quot;&lt;/span&gt;)
                };
&lt;span style=&quot;color: blue;&quot;&gt;    return &lt;/span&gt;items;
  }

}&lt;/pre&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;So our service is completed and ready for consumption by the client.Now we need to create the silverlight client.Add service reference to the Silverlight project and then create a user control in the silverlight project, in the sample you can see the user control UC_RSSReader.xaml. I added some controls like ListBox in this usercontrol, templated and added binding for those controls.We edited the ItemTemplate for the ListBox and added custom data template which consist of TextBlocks and ListBox to display the feed data as required.We can customize this as per our requirement or as per the amount of data to be displayed.Now we are having the usercontrol that is binded to the corresponding properties. ListBox is displaying the feed data from the URL and the XAML looks like,&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;border: 1px solid; overflow: auto; width: 530px;&quot;&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;ListBox &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;RSSFeed&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;VerticalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Stretch&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Stretch&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Grid.Row&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;2&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Grid.ColumnSpan&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;2&quot;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;ListBox.ItemTemplate&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;DataTemplate&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Grid &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;MinWidth&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;{&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Binding &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;ElementName&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=LayoutRoot, &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Path&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=ActualWidth}&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;MaxWidth&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;{&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Binding &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;ElementName&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=LayoutRoot, &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Path&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=ActualWidth}&quot;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;RowDefinition &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;RowDefinition &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;RowDefinition &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;TextBlock &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;{&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Binding &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Title&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;}&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;FontFamily&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Verdana&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;FontSize&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;13&quot; /&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;TextBlock &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Grid.Row&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;2&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;{&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Binding &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;PublishDate&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;}&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Left&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;FontFamily&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Verdana&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;FontSize&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;11&quot; /&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;HyperlinkButton &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Grid.Row&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;2&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Content&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Read Article&amp;gt;&amp;gt;&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;NavigateUri&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;{&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Binding &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Permalink&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;}&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Center&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;FontFamily&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Verdana&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;FontSize&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;11&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;FontStyle&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Italic&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;ToolTipService.ToolTip&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;{&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Binding &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Title&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;}&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;TargetName&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;__blank&quot; /&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Grid&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;DataTemplate&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;ListBox.ItemTemplate&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;ListBox&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;I am not using MVVM for this application as this is a very basic sample.Event subscribtion is straight forward and we have all the logic in the code behind itself.While clicking the fetch Button we are sending the request to the service with the feed url entered, fetching the data from the service and binding that result with ListBox. ListBox will display the Title, PublishDate and also a permalink to the original feed item. &lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;border: 1px solid; overflow: auto; width: 530px;&quot;&gt;&lt;br /&gt;
&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;private void &lt;/span&gt;FetchRSS_Click(&lt;span style=&quot;color: blue;&quot;&gt;object &lt;/span&gt;sender, &lt;span style=&quot;color: #2b91af;&quot;&gt;RoutedEventArgs &lt;/span&gt;e)
{
&lt;span style=&quot;color: blue;&quot;&gt;  if &lt;/span&gt;(!&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;.IsNullOrEmpty(RSSFeedUrlTextBox.Text.Trim()) 
     &amp;amp;&amp;amp; &lt;span style=&quot;color: #2b91af;&quot;&gt;Uri&lt;/span&gt;.IsWellFormedUriString(RSSFeedUrlTextBox.Text.Trim(), &lt;span style=&quot;color: #2b91af;&quot;&gt;UriKind&lt;/span&gt;.Absolute))
  {
    LoadingTextBlock.Visibility = &lt;span style=&quot;color: #2b91af;&quot;&gt;Visibility&lt;/span&gt;.Visible;
    RSSFeed.Items.Clear();
&lt;span style=&quot;color: #2b91af;&quot;&gt;    RSSReaderServiceClient &lt;/span&gt;RSSReaderServiceClient = &lt;span style=&quot;color: blue;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;RSSReaderServiceClient&lt;/span&gt;();
    RSSReaderServiceClient.GetFeedCompleted += &lt;span style=&quot;color: blue;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;EventHandler&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;GetFeedCompletedEventArgs&lt;/span&gt;&amp;gt;(RSSReaderServiceClient_GetFeedCompleted);
    RSSReaderServiceClient.GetFeedAsync((&lt;span style=&quot;color: blue;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Uri&lt;/span&gt;(RSSFeedUrlTextBox.Text)).ToString());                
  }
}

&lt;span style=&quot;color: blue;&quot;&gt;void &lt;/span&gt;RSSReaderServiceClient_GetFeedCompleted(&lt;span style=&quot;color: blue;&quot;&gt;object &lt;/span&gt;sender, &lt;span style=&quot;color: #2b91af;&quot;&gt;GetFeedCompletedEventArgs &lt;/span&gt;e)
{
  RSSFeed.ItemsSource = e.Result;
  LoadingTextBlock.Visibility = &lt;span style=&quot;color: #2b91af;&quot;&gt;Visibility&lt;/span&gt;.Collapsed;
}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;Add this usercontrol to the main page and compile it.Before running the application don&#39;t forget to put the cross domain policy file in the web application root.Otherwise silverlight client can&#39;t communicate with the WCF service.If you get any run time errors for the sample application then delete  and add the service reference again in the silverlight project. &lt;/div&gt;&lt;br /&gt;
&lt;iframe frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://cid-351bd96abe8dc097.skydrive.live.com/embedicon.aspx/CodeNet/RSSReader.zip&quot; style=&quot;background-color: #fcfcfc; height: 115px; padding: 0pt; width: 98px;&quot; title=&quot;Preview&quot;&gt;&lt;/iframe&gt;</description><link>http://codepronet.blogspot.com/2010/05/silverlight-rss-reader.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEb4EWHjifujljuBbMfi89I_xoPN8swog2DcSD2Vjziypm7xjrVyVZw1yIRro97b7m2zdNI6wZTyMTAzsTPrMRKsO5ZiistUE4hUku4UNp__21FiPlowsb4t2G21Z76zLVckqON4bNEJU/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7209751425484679379.post-5083023825839242752</guid><pubDate>Wed, 31 Mar 2010 07:09:00 +0000</pubDate><atom:updated>2010-06-30T11:14:09.566+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">Ajax</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET 2.0</category><category domain="http://www.blogger.com/atom/ns#">JavaScript</category><category domain="http://www.blogger.com/atom/ns#">XML</category><title>Slideshow using Javascript</title><description>&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM7cB-ThC2YfRP6ODkks-Io91erZE6a-rc2ZIVUqMeqcJkQHViirk_y3jPCBqjlcq7Gt-4rRSnp5naCEtO-bBuKAeirtlAKe2q7wy0ytlRHS_A4X04jw0VQmvqW8MViJGluAO4CCBV1vI/s1600-h/screenshot%5B6%5D.png&quot;&gt;&lt;img alt=&quot;Slideshow using Javascript&quot; border=&quot;0&quot; height=&quot;226&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0Ty6mRe8ygxRuvEqrTRVzBS1s84wjKSyYvfs2ojQOG-7WZ4B6OqbqggvHOHBXKOkg6nGYzGxs2wadQrxzP-ryC5oFFXgySmgk65hMicdJp6ADNvrbmx2M1ZcEx2AzWEJLzE8WkIQJVm4/?imgmax=800&quot; style=&quot;border: 0px none; display: inline;&quot; title=&quot;Slideshow using Javascript&quot; width=&quot;304&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;div style=&quot;color: black; font-family: inherit;&quot;&gt;This is a web application for displaying a slideshow using Asynchronous javascript and XML or AJAX, a simple SlideshowClient web application having next/previous manual image switching and normal Start/Stop slideshow options.This application basically using client side scripting using javascript and XMLHTTPRequest.Our ultimate aim is to show the images and switch them without posting the page back.So definitely we should use any client side scripting language for this asynchronous behavior and ofcourse javascript do the job.  &lt;/div&gt;&lt;div style=&quot;color: black; font-family: inherit;&quot;&gt;If we are only using images, then we can directly change image control source within the javascript. But here we want some description or some display information for each image.So i choose a simple xml file to store the data required for the slideshow. I only added description here as informational data but we can add more details as per the requirement.&lt;/div&gt;&lt;div style=&quot;border: 1px solid; overflow: auto; width: 530px;&quot;&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xml &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;version&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;1.0&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;encoding&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;utf-8&lt;/span&gt;&quot; &lt;span style=&quot;color: blue;&quot;&gt;?&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;SlideshowClient&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Slideshow&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;SlideshowId&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;1200&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;SlideshowId&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;ImagePath&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;/Images/IMG_1573.jpg&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;ImagePath&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;/&amp;gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Description&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;Colors of Life&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Description&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Slideshow&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Slideshow&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;SlideshowId&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;1201&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;SlideshowId&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;ImagePath&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;/Images/IMG_1209.jpg&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;ImagePath&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;/&amp;gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Description&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;Leaf on the Floor&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Description&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Slideshow&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Slideshow&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;SlideshowId&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;1202&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;SlideshowId&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;ImagePath&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;/Images/IMG_1229.jpg&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;ImagePath&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;/&amp;gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Description&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;Street Light&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Description&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Slideshow&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Slideshow&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;SlideshowId&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;1203&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;SlideshowId&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;ImagePath&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;/Images/IMG_1295.jpg&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;ImagePath&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;/&amp;gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Description&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;Sunset&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Description&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Slideshow&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Slideshow&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;SlideshowId&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;1204&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;SlideshowId&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;ImagePath&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;/Images/IMG_1201.jpg&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;ImagePath&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;/&amp;gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Description&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;BackWater&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Description&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Slideshow&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;SlideshowClient&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;In the web page i added some HTML controls required for the slideshow. So now comes the question. How it actually works? its not much complicated.I am using the hero XMLHttpRequest for getting the data from the server each time user interacts with the application. &lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;border: 1px solid; overflow: auto; width: 530px;&quot;&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;//cross browser object for XMLHttpRequest
&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;var &lt;/span&gt;xmlHttpRequest = (window.XMLHttpRequest) ? &lt;span style=&quot;color: blue;&quot;&gt;new &lt;/span&gt;window.XMLHttpRequest()
: &lt;span style=&quot;color: blue;&quot;&gt;new &lt;/span&gt;ActiveXObject(&lt;span style=&quot;color: #a31515;&quot;&gt;&#39;Microsoft.XMLHTTP&#39;&lt;/span&gt;);
xmlHttpRequest.open(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;GET&quot;&lt;/span&gt;, &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;/Data/SlideshowClientData.xml&quot;&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;false&lt;/span&gt;);
xmlHttpRequest.send(&lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;);
&lt;span style=&quot;color: green;&quot;&gt;//fetching the responseXML from the request
&lt;/span&gt;xmlDoc = xmlHttpRequest.responseXML;&lt;/pre&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
We are fetching the response from responseXML attribute of the request object.So how we are going to parse this xml data? For parsing the xml data we use element.selectSingleNode(&quot;ElementName&quot;)and showing Next/Previous image and its description. But when i checked this behavior in different browsers i found this method is not supported in some browsers. So i tried for some workarounds and finally found Wrox&#39;s article &lt;/span&gt;&lt;a href=&quot;http://www.wrox.com/WileyCDA/Section/id-291861.html&quot; target=&quot;_blank&quot;&gt;XPath support in Firefox&lt;/a&gt;. I added selectSingleNode prototype for Element for cross browser compatibility. If selectSingleNode method is not supported i am prototyping the method. &lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;border: 1px solid; overflow: auto; width: 530px;&quot;&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;function &lt;/span&gt;ElementProtoType() {
&lt;span style=&quot;color: blue;&quot;&gt;if &lt;/span&gt;(document.implementation.hasFeature(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;XPath&quot;&lt;/span&gt;, &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;3.0&quot;&lt;/span&gt;)) {
&lt;span style=&quot;color: green;&quot;&gt;//Some of the browsers not supporting selectSingleNode
&lt;/span&gt;Element.prototype.selectSingleNode = &lt;span style=&quot;color: blue;&quot;&gt;function&lt;/span&gt;(xPath) {
&lt;span style=&quot;color: blue;&quot;&gt;var &lt;/span&gt;evaluator = &lt;span style=&quot;color: blue;&quot;&gt;new &lt;/span&gt;XPathEvaluator();
&lt;span style=&quot;color: blue;&quot;&gt;var &lt;/span&gt;result = evaluator.evaluate(xPath, &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;,XPathResult.FIRST_ORDERED_NODE_TYPE, &lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;);
&lt;span style=&quot;color: blue;&quot;&gt;if &lt;/span&gt;(result != &lt;span style=&quot;color: blue;&quot;&gt;null &lt;/span&gt;&amp;amp;&amp;amp; result.singleNodeValue != &lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;) {
result.singleNodeValue.nodeTypedValue = result.singleNodeValue.textContent;
&lt;span style=&quot;color: blue;&quot;&gt;return &lt;/span&gt;result.singleNodeValue;
}
&lt;span style=&quot;color: blue;&quot;&gt;else &lt;/span&gt;{
&lt;span style=&quot;color: blue;&quot;&gt;return null&lt;/span&gt;;
}
}
}
}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;So now everything looks good and Next/previous will work in almost all browsers. So our basic logic for changing the image looks like, &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;border: 1px solid; overflow: auto; width: 530px;&quot;&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;function &lt;/span&gt;ShowNextImage() {
&lt;span style=&quot;color: blue;&quot;&gt;if &lt;/span&gt;(xmlDoc != &lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;) {
&lt;span style=&quot;color: blue;&quot;&gt;var &lt;/span&gt;flag = &lt;span style=&quot;color: blue;&quot;&gt;false&lt;/span&gt;;
&lt;span style=&quot;color: green;&quot;&gt;//Getting Previous image from data xml.
&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;for &lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;var &lt;/span&gt;i = 0; i &amp;lt; xmlDoc.documentElement.childNodes.length; i++) {
&lt;span style=&quot;color: blue;&quot;&gt;var &lt;/span&gt;element = xmlDoc.documentElement.childNodes[i];
&lt;span style=&quot;color: blue;&quot;&gt;if &lt;/span&gt;(element.nodeType == 1 &amp;amp;&amp;amp; element.selectSingleNode(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;SlideshowId&quot;&lt;/span&gt;) != &lt;span style=&quot;color: blue;&quot;&gt;null &lt;/span&gt;&amp;amp;&amp;amp;
element.selectSingleNode(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;SlideshowId&quot;&lt;/span&gt;).nodeTypedValue == currentSlideshowId + 1) {
document.getElementById(&lt;span style=&quot;color: #a31515;&quot;&gt;&#39;slideshowimg&#39;&lt;/span&gt;).src = element.selectSingleNode(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;ImagePath&quot;&lt;/span&gt;).nodeTypedValue;
document.getElementById(&lt;span style=&quot;color: #a31515;&quot;&gt;&#39;description&#39;&lt;/span&gt;).innerHTML = element.selectSingleNode(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Description&quot;&lt;/span&gt;).nodeTypedValue;
currentSlideshowId = currentSlideshowId + 1;
flag = &lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;;
&lt;span style=&quot;color: blue;&quot;&gt;break&lt;/span&gt;;
}
}

&lt;span style=&quot;color: blue;&quot;&gt;if &lt;/span&gt;(!flag &amp;amp;&amp;amp; interval != &lt;span style=&quot;color: blue;&quot;&gt;null &lt;/span&gt;&amp;amp;&amp;amp; anchor != &lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;) {
StopSlideshow(anchor);
}
}
}&lt;/pre&gt;&lt;/div&gt;&lt;div style=&quot;color: black; font-family: inherit;&quot;&gt;I tested this application in almost all latest browsers including IE, Firefox, Google Chrome, Safari and it is working good.&lt;br /&gt;
&lt;p/&gt;PS : If we use larger size images adjust the timer according to the loading time for image otherwise in some browsers while playing the slideshow it wont get time to load the image and it&#39;ll only slide through the description.&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Download Source Code,&lt;/span&gt;&lt;/div&gt;&lt;iframe frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://cid-351bd96abe8dc097.skydrive.live.com/embedicon.aspx/CodeNet/SlideshowClient.zip&quot; style=&quot;background-color: #fcfcfc; height: 115px; padding: 0pt; width: 150px;&quot; title=&quot;Preview&quot;&gt;&lt;/iframe&gt;</description><link>http://codepronet.blogspot.com/2010/03/slideshow-using-javascript.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0Ty6mRe8ygxRuvEqrTRVzBS1s84wjKSyYvfs2ojQOG-7WZ4B6OqbqggvHOHBXKOkg6nGYzGxs2wadQrxzP-ryC5oFFXgySmgk65hMicdJp6ADNvrbmx2M1ZcEx2AzWEJLzE8WkIQJVm4/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7209751425484679379.post-5788391905495799189</guid><pubDate>Thu, 11 Feb 2010 09:56:00 +0000</pubDate><atom:updated>2010-05-28T13:07:33.454+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">Visual Studio 2010</category><title>Visual Studio 2010 RC Released</title><description>&lt;div style=&quot;font-family: inherit;&quot;&gt;Visual Studio 2010 RC is released with lot of cool features. I installed it but i don’t know when’ll i get time to experiment that as am busy with my projects. Anyway I want to try Charting Controls for ASP.NET &amp;amp; Windows Forms first. Charting control is looking nice. I hope I can post more code snippets for Visual Studio 2010 soon.&lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;Splash Screen&lt;/div&gt;&amp;nbsp;&lt;img alt=&quot;visualstudio_splash&quot; border=&quot;0&quot; height=&quot;279&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTbhdCo7dHCAXkAUPd-lfzB9tM2Z1rl4BM0fJWW4Klh2KzEDAq1ujOZXl2Hlos4X1U6I0uzsaXU4FljIN2a4eyCs5ry1kaAoJHcuB4Ijv47tD0FXxzTwp_HMtQs_CYyUifq43c0WweDj8/?imgmax=800&quot; style=&quot;border: 0px none; display: inline;&quot; title=&quot;visualstudio_splash&quot; width=&quot;400&quot; /&gt; &lt;br /&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;Download &lt;a href=&quot;http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx&quot; target=&quot;_blank&quot;&gt;Visual Studio 2010 RC&lt;/a&gt;&lt;/div&gt;</description><link>http://codepronet.blogspot.com/2010/02/visual-studio-2010-rc-released.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTbhdCo7dHCAXkAUPd-lfzB9tM2Z1rl4BM0fJWW4Klh2KzEDAq1ujOZXl2Hlos4X1U6I0uzsaXU4FljIN2a4eyCs5ry1kaAoJHcuB4Ijv47tD0FXxzTwp_HMtQs_CYyUifq43c0WweDj8/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7209751425484679379.post-499347628359820402</guid><pubDate>Thu, 04 Feb 2010 10:42:00 +0000</pubDate><atom:updated>2010-05-28T13:16:01.218+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">C#</category><category domain="http://www.blogger.com/atom/ns#">LINQ</category><title>Getting Property Name using LINQ</title><description>Sometimes we want to compare the property names like,&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: courier new; font-size: 85%;&quot;&gt;if &lt;/span&gt;&lt;span style=&quot;font-family: courier new; font-size: 85%;&quot;&gt;(e.PropertyName == &lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: courier new; font-size: 85%;&quot;&gt;&quot;FirstName&quot;&lt;/span&gt;&lt;span style=&quot;font-family: courier new; font-size: 85%;&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: courier new;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;font-size: 100%;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900; font-family: courier new; font-size: 85%;&quot;&gt;//Do Something&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: courier new;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;But this is not type safe. If we change the property name then this won’t work as expected and also it won’t throw compile time error. For getting property name for Type safe operations we can use LINQ. So if you change property name in future, you’ll get compile time error.&lt;/div&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public string &lt;/span&gt;GetPropertyName&amp;lt;T&amp;gt;(&lt;span style=&quot;color: #2b91af;&quot;&gt;Expression&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Func&lt;/span&gt;&amp;lt;T&amp;gt;&amp;gt; expression)
{
&lt;span style=&quot;color: #2b91af;&quot;&gt;   MemberExpression &lt;/span&gt;memberExpression=(&lt;span style=&quot;color: #2b91af;&quot;&gt;MemberExpression)&lt;/span&gt;expression.Body;
&lt;span style=&quot;color: blue;&quot;&gt;   return &lt;/span&gt;memberExpression.Member.Name;
}&lt;/pre&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;We can call this method using Expression Lambdas like,&lt;/div&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;if &lt;/span&gt;(e.PropertyName == GetPropertyName(() =&amp;gt; Customer.FirstName))
{
&lt;span style=&quot;color: green;&quot;&gt;  //Do Something
&lt;/span&gt;}&lt;/pre&gt;</description><link>http://codepronet.blogspot.com/2010/02/getting-property-name-using-linq.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7209751425484679379.post-1318626844269445872</guid><pubDate>Mon, 18 Jan 2010 08:11:00 +0000</pubDate><atom:updated>2010-01-18T13:41:19.926+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Identitymine</category><category domain="http://www.blogger.com/atom/ns#">Microsoft Surface</category><title>IdentityMine&amp;#39;s Retail Map on Microsoft Surface at NRF 2010</title><description>&lt;object width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/U0l_tYSwFQ0&amp;amp;hl=en_US&amp;amp;fs=1&amp;amp;&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/U0l_tYSwFQ0&amp;amp;hl=en_US&amp;amp;fs=1&amp;amp;&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;/embed&gt;&lt;/object&gt;  </description><link>http://codepronet.blogspot.com/2010/01/identitymine-retail-map-on-microsoft.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7209751425484679379.post-401803033391117704</guid><pubDate>Sat, 19 Sep 2009 05:32:00 +0000</pubDate><atom:updated>2010-05-28T13:08:55.102+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">C#</category><category domain="http://www.blogger.com/atom/ns#">WPF</category><category domain="http://www.blogger.com/atom/ns#">XML</category><title>XML to Class in .NET – XML Schema Definition Tool(XSD.exe)</title><description>&lt;div style=&quot;font-family: inherit;&quot;&gt;Most of us faced the scenario that we need to deserialize the xml data got from a service or some other source to an object.So how can we do that?Lets have a look at that. &lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;First of all i have an XML like,&lt;/div&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xml &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;version&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;1.0&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;encoding&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;UTF-8&lt;/span&gt;&quot; &lt;span style=&quot;color: blue;&quot;&gt;?&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Orders&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Customer &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Id&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;001&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;Customer1&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Address&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;Address1&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Address&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;EmailId&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;EmailId&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;EmailId&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Items&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Item &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Id&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;100&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Item1&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Item &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Id&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;101&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Item2&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Items&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Customer&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Customer &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Id&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;002&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;Customer2&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Address&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;Address1&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Address&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;EmailId&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;EmailId&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;EmailId&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Items&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Item &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Id&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;103&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Item3&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Item &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Id&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;103&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Item4&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Items&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Customer&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Orders&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;So we need to generate a class from this XML.Here comes &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/x6c1kb0s%28VS.71%29.aspx&quot;&gt;XML Schema Definition Tool&lt;/a&gt; or XSD.exe.So we are creating an XML Schema definition first from the above XML.&lt;/div&gt;&lt;ul style=&quot;font-family: inherit;&quot;&gt;&lt;li&gt;Go to Visual Studio&amp;gt;Visual Studio Tools&amp;gt;Visual Studio Command Prompt. &lt;/li&gt;
&lt;li&gt;Navigate to the folder where we have the XML data or we can directly target the xml path.I am navigating to the folder having above xml and type the command xsd.exe Customer.xml and this&#39;ll generate a schema definition file Customer.xsd.&lt;br /&gt;
&lt;br /&gt;
XML Schema Definition looks like,&lt;/li&gt;
&lt;/ul&gt;&lt;blockquote&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xml &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;version&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;1.0&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;encoding&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;utf-8&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;?&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:schema &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Orders&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;xmlns&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&quot; &lt;span style=&quot;color: red;&quot;&gt;xmlns:xs&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;http://www.w3.org/2001/XMLSchema&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;xmlns:msdata&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;urn:schemas-microsoft-com:xml-msdata&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:element &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Orders&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;msdata:IsDataSet&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;msdata:UseCurrentLocale&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:complexType&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:choice &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;minOccurs&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;maxOccurs&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;unbounded&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:element &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Customer&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:complexType&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:sequence&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:element &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Name&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;xs:string&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;minOccurs&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;msdata:Ordinal&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;&quot; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:element &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Address&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;xs:string&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;minOccurs&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;msdata:Ordinal&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;&quot; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:element &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;EmailId&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;xs:string&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;minOccurs&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;msdata:Ordinal&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;2&lt;/span&gt;&quot; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:element &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Items&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;minOccurs&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;maxOccurs&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;unbounded&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:complexType&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:sequence&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:element &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Item&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;minOccurs&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;maxOccurs&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;unbounded&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:complexType&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:attribute &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Id&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;xs:string&lt;/span&gt;&quot; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:attribute &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Name&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;xs:string&lt;/span&gt;&quot; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:complexType&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:element&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:sequence&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:complexType&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:element&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:sequence&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:attribute &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Id&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;xs:string&lt;/span&gt;&quot; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:complexType&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:element&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:choice&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:complexType&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:element&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;xs:schema&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;ul style=&quot;font-family: inherit;&quot;&gt;&lt;li&gt;Now use command, xsd.exe Customer.xsd /c, for generate class from the schema definition file. It&#39;ll generate a class with default language as C#,customer.cs is generated in the folder and its having partial class Orders, &lt;/li&gt;
&lt;/ul&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: grey;&quot;&gt;     /// &amp;lt;remarks/&amp;gt;
&lt;/span&gt;     [System.CodeDom.Compiler.&lt;span style=&quot;color: #2b91af;&quot;&gt;GeneratedCodeAttribute&lt;/span&gt;(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;xsd&quot;&lt;/span&gt;, &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;2.0.50727.3038&quot;&lt;/span&gt;)]
[System.&lt;span style=&quot;color: #2b91af;&quot;&gt;SerializableAttribute&lt;/span&gt;()]
[System.Diagnostics.&lt;span style=&quot;color: #2b91af;&quot;&gt;DebuggerStepThroughAttribute&lt;/span&gt;()]
[System.ComponentModel.&lt;span style=&quot;color: #2b91af;&quot;&gt;DesignerCategoryAttribute&lt;/span&gt;(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;code&quot;&lt;/span&gt;)]
[System.Xml.Serialization.&lt;span style=&quot;color: #2b91af;&quot;&gt;XmlTypeAttribute&lt;/span&gt;(AnonymousType=&lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;)]
[System.Xml.Serialization.&lt;span style=&quot;color: #2b91af;&quot;&gt;XmlRootAttribute&lt;/span&gt;(Namespace=&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;&quot;&lt;/span&gt;, IsNullable=&lt;span style=&quot;color: blue;&quot;&gt;false&lt;/span&gt;)]
&lt;span style=&quot;color: blue;&quot;&gt;   public partial class &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Orders &lt;/span&gt;{&lt;/pre&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;Please note : you can see type &lt;/b&gt;&lt;b&gt;OrdersCustomerItemsItem[][]&lt;/b&gt;&lt;b&gt; for Items property and for its private variable.Change it as &lt;/b&gt;&lt;b&gt;OrdersCustomerItemsItem[]&lt;/b&gt;&lt;b&gt;,Otherwise while Deserializing it&#39;ll show error.&lt;/b&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;By Using  System.Xml.Serialization.&lt;/span&gt;&lt;span style=&quot;color: #2b91af; font-family: inherit;&quot;&gt;XmlSerializer &lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;we can Deserialize the XML to Order object.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;private void &lt;/span&gt;PopulateData()
{
&lt;span style=&quot;color: #2b91af;&quot;&gt;    StreamReader &lt;/span&gt;stream = &lt;span style=&quot;color: blue;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;StreamReader&lt;/span&gt;(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Customer.xml&quot;&lt;/span&gt;);
&lt;span style=&quot;color: #2b91af;&quot;&gt;    XmlSerializer &lt;/span&gt;serializer = &lt;span style=&quot;color: blue;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;XmlSerializer&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;typeof&lt;/span&gt;(&lt;span style=&quot;color: #2b91af;&quot;&gt;Orders&lt;/span&gt;));
&lt;span style=&quot;color: #2b91af;&quot;&gt;    Orders &lt;/span&gt;orders = (&lt;span style=&quot;color: #2b91af;&quot;&gt;Orders&lt;/span&gt;)serializer.Deserialize(stream);
OrdersList.ItemsSource = orders.Items;
}&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;ul style=&quot;font-family: inherit;&quot;&gt;&lt;li&gt;Build and Run the application you can see the Customers displayed in the UI. &lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;iframe frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://cid-351bd96abe8dc097.skydrive.live.com/embedicon.aspx/CodeNet/XMLToClass.zip&quot; style=&quot;background-color: #fcfcfc; height: 115px; padding: 0px; width: 100px;&quot; title=&quot;Preview&quot;&gt;&lt;/iframe&gt;</description><link>http://codepronet.blogspot.com/2009/09/xml-to-class-in-net-xml-schema.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7209751425484679379.post-4417879563970878107</guid><pubDate>Fri, 14 Aug 2009 09:49:00 +0000</pubDate><atom:updated>2010-10-13T12:09:46.547+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">Silverlight</category><category domain="http://www.blogger.com/atom/ns#">WPF</category><title>Implementing INotifyPropertyChanged</title><description>&lt;div style=&quot;font-family: inherit;&quot;&gt;If an object implementing &lt;span style=&quot;color: #2b91af;&quot;&gt;INotifyPropertyChanged &lt;/span&gt;Interface it’ll raise a property changed event when its property changes.Lets create a sample application to know how we can implement &lt;span style=&quot;color: #2b91af;&quot;&gt;INotifyPropertyChanged&lt;/span&gt; Interface. I am creating a Silverlight application which demonstrates the data binding with both an object implementing &lt;span style=&quot;color: #2b91af;&quot;&gt;INotifyPropertyChanged&lt;/span&gt; and also a normal &lt;span style=&quot;color: #2b91af;&quot;&gt;DependencyProperty&lt;/span&gt;.  &lt;/div&gt;&lt;ul&gt;&lt;li style=&quot;font-family: inherit;&quot;&gt;Open Visual Studio and select a new silverlight application. &lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Create a class named Customer in the silverlight project and implement &lt;/span&gt;&lt;span style=&quot;color: #2b91af; font-family: inherit;&quot;&gt;INotifyPropertyChanged&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;.&lt;/span&gt; &lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;border-bottom: 1px solid; border-left: 1px solid; border-right: 1px solid; border-top: 1px solid; overflow: auto; width: 530px;&quot;&gt;&lt;blockquote&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public class &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Customer &lt;/span&gt;: &lt;span style=&quot;color: #2b91af;&quot;&gt;INotifyPropertyChanged
&lt;/span&gt;{&lt;/pre&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;ul style=&quot;font-family: inherit;&quot;&gt;&lt;li&gt;Define INotifyPropertyChanged Members,&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;border-bottom: 1px solid; border-left: 1px solid; border-right: 1px solid; border-top: 1px solid; overflow: auto; width: 530px;&quot;&gt;&lt;blockquote&gt;&lt;div align=&quot;left&quot;&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public event &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;PropertyChangedEventHandler &lt;/span&gt;PropertyChanged;

&lt;span style=&quot;color: blue;&quot;&gt;public void &lt;/span&gt;OnPropertyChanged(&lt;span style=&quot;color: #2b91af;&quot;&gt;PropertyChangedEventArgs &lt;/span&gt;e)
{
&lt;span style=&quot;color: blue;&quot;&gt;   if &lt;/span&gt;(PropertyChanged != &lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;)
   {
     PropertyChanged(&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;, e);
   }
}
&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;  &lt;span style=&quot;font-family: inherit;&quot;&gt;In property setter invoke OnPropertyChanged by passing property name like,&lt;/span&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;border-bottom: 1px solid; border-left: 1px solid; border-right: 1px solid; border-top: 1px solid; overflow: auto; width: 530px;&quot;&gt;&lt;blockquote&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;private string &lt;/span&gt;_Name;

&lt;span style=&quot;color: blue;&quot;&gt;public string &lt;/span&gt;Name
{
&lt;span style=&quot;color: blue;&quot;&gt;  get
&lt;/span&gt;  {
&lt;span style=&quot;color: blue;&quot;&gt;     return &lt;/span&gt;_Name;
  }
&lt;span style=&quot;color: blue;&quot;&gt;  set
&lt;/span&gt;  {
    _Name = &lt;span style=&quot;color: blue;&quot;&gt;value&lt;/span&gt;;
    OnPropertyChanged(&lt;span style=&quot;color: blue;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;PropertyChangedEventArgs(&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Name&quot;&lt;/span&gt;));
  }
}
&lt;/pre&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;  &lt;pre class=&quot;code&quot; style=&quot;font-family: inherit;&quot;&gt;In MainPage.xaml.cs add an ObservableCollection of customer object as Dependency
property inorder to make sure that UI is updating while we assigning that customer list
to another list or object.If we are making it as a normal property UI will update only if
we add new object to customerlist or any change occurs to the underlying properties.&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;border-bottom: 1px solid; border-left: 1px solid; border-right: 1px solid; border-top: 1px solid; overflow: auto; width: 530px;&quot;&gt;&lt;blockquote&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;ObservableCollection&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Customer&lt;/span&gt;&amp;gt; CustomerList
{
&lt;span style=&quot;color: blue;&quot;&gt;  get &lt;/span&gt;{ &lt;span style=&quot;color: blue;&quot;&gt;return &lt;/span&gt;(&lt;span style=&quot;color: #2b91af;&quot;&gt;ObservableCollection&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Customer&lt;/span&gt;&amp;gt;)
GetValue(CustomerListProperty); }
&lt;span style=&quot;color: blue;&quot;&gt;  set &lt;/span&gt;{ SetValue(CustomerListProperty, &lt;span style=&quot;color: blue;&quot;&gt;value&lt;/span&gt;); }
}

&lt;span style=&quot;color: green;&quot;&gt;// Using a DependencyProperty as the backing store for MyProperty.
This enables animation, styling, binding, etc...
&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;public static readonly &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;DependencyProperty &lt;/span&gt;CustomerListProperty =
&lt;span style=&quot;color: #2b91af;&quot;&gt;DependencyProperty&lt;/span&gt;.Register(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;CustomerList&quot;&lt;/span&gt;,
&lt;span style=&quot;color: blue;&quot;&gt;typeof&lt;/span&gt;(&lt;span style=&quot;color: #2b91af;&quot;&gt;ObservableCollection&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Customer&lt;/span&gt;&amp;gt;), &lt;span style=&quot;color: blue;&quot;&gt;typeof&lt;/span&gt;(&lt;span style=&quot;color: #2b91af;&quot;&gt;MainPage&lt;/span&gt;),
&lt;span style=&quot;color: blue;&quot;&gt;    new &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;PropertyMetadata&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;ObservableCollection&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Customer&lt;/span&gt;&amp;gt;()));&lt;/pre&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;ul style=&quot;font-family: inherit;&quot;&gt;&lt;li&gt;I also added a DependencyProperty FirstName in MainPage.xaml.cs just to show the binding of a simple DependencyProperty.&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;border-bottom: 1px solid; border-left: 1px solid; border-right: 1px solid; border-top: 1px solid; overflow: auto; width: 530px;&quot;&gt;&lt;blockquote&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public string &lt;/span&gt;FirstName
{
&lt;span style=&quot;color: blue;&quot;&gt;  get &lt;/span&gt;{ &lt;span style=&quot;color: blue;&quot;&gt;return &lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;)GetValue(FirstNameProperty); }
&lt;span style=&quot;color: blue;&quot;&gt;  set &lt;/span&gt;{ SetValue(FirstNameProperty, &lt;span style=&quot;color: blue;&quot;&gt;value&lt;/span&gt;); }
}

&lt;span style=&quot;color: green;&quot;&gt;// Using a DependencyProperty as the backing store for MyProperty.
This enables animation, styling, binding, etc...
&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;public static readonly &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;DependencyProperty &lt;/span&gt;FirstNameProperty =
&lt;span style=&quot;color: #2b91af;&quot;&gt;  DependencyProperty&lt;/span&gt;.Register(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;FirstName&quot;&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;typeof&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;), &lt;span style=&quot;color: blue;&quot;&gt;typeof&lt;/span&gt;(&lt;span style=&quot;color: #2b91af;&quot;&gt;MainPage&lt;/span&gt;),
&lt;span style=&quot;color: blue;&quot;&gt;  new &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;PropertyMetadata&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;.Empty)); &lt;/pre&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;ul style=&quot;font-family: inherit;&quot;&gt;&lt;li&gt;In MainPage.XAML add a datagrid and textbox and bind it to the ObservableCollection and DependencyProperty respectively.&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;border-bottom: 1px solid; border-left: 1px solid; border-right: 1px solid; border-top: 1px solid; overflow: auto; width: 530px;&quot;&gt;&lt;blockquote&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;data&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;DataGrid &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;AutoGenerateColumns&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;True&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt; Width&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;400&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt; Height&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;300&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt; ItemsSource&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;{&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Binding &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;ElementName&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=TestUC,
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;                                Path&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=CustomerList}&quot;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;TextBox &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;NameTextBox&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;{&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Binding &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;ElementName&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=TestUC, &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Path&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=FirstName, &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Mode&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=TwoWay}&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Width&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;100&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Height&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;25&quot;
&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Margin&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;0,10,0,10&quot; /&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;ul&gt;&lt;li style=&quot;font-family: inherit;&quot;&gt;For Understanding PropertyChanged event, I added a button and just updating the customer object in the click event so that you can see the changes in the datagrid.When you change the property of Customer object from click event you can see that the UI is updating accordingly.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Download Sample Application.&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt; &lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;iframe frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://cid-351bd96abe8dc097.skydrive.live.com/embedrowdetail.aspx/CodeNet/INotifyPropertyChangedSample.zip&quot; style=&quot;background-color: white; border: 1px solid rgb(221, 229, 233); height: 66px; margin-left: 50px; padding: 0pt; width: 240px;&quot;&gt;&lt;/iframe&gt;</description><link>http://codepronet.blogspot.com/2009/08/implementing-inotifypropertychanged.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7209751425484679379.post-9176744983344801661</guid><pubDate>Thu, 30 Jul 2009 05:02:00 +0000</pubDate><atom:updated>2010-06-22T11:49:16.641+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><category domain="http://www.blogger.com/atom/ns#">Silverlight</category><category domain="http://www.blogger.com/atom/ns#">WCF</category><title>Silverlight With WCF Service</title><description>&lt;blockquote style=&quot;font-family: inherit;&quot;&gt;How to use a WCF Service from a silverlight client?Let us discuss how we can achieve that.Sample application is also attached in the bottom of this article.&lt;/blockquote&gt;&lt;ul&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;/div&gt;&lt;ul style=&quot;font-family: inherit;&quot;&gt;&lt;li&gt;Open Visual Studio and Create a new Silverlight application by selecting any of the available project templates in visual studio.Here i am selecting Silverlight Navigation Application, &lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVC4P00WHYnUHbnfEWLLmnT-lau7BoJpwPXG9iqJc1rdLo6eD9oeogWskE6aFB1SuPpjtO8O21DeG-ASxx8_NPbmrZmUxchGYJn_1ErbFecBuebbHg8E2zW5trFwCkI3a0a8NrtXNTIjQ/s1600-h/image%5B22%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;354&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE-PTIBZrN7oEYpE9lZceYtpqXoXf-lGF5EOK9nYfSSVdALM-mN5_tGPQVLoDhaYpZ7SfqygS35uLPDhtm3RxSa2MrC0s65YtqLGOL5WWiqL1Z0WnIuOpaAEg_6IHNrLhF571njCJkM9s/?imgmax=800&quot; style=&quot;border-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;488&quot; /&gt;&lt;/a&gt; &lt;/blockquote&gt;&lt;blockquote&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4pACp9tP1CVGu5pHt4VpP-kXk0N0ujp3OD2gz-JormoiF0R6L9mC-xwcnWndPSISZELAp-FMmLQK_rDqsnmwgqo45UFE_W9394fkkgVmdQkxtKJBeYXXz-dA1S3zNCTyWWK92cQdA4_k/s1600-h/image%5B11%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;362&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgijPfGvUWCtT3F8CDO1_VrN7eUPhJgEarTSsfHc5Z9gXfMQW_D9r1ZtD0JAet8WIZmZt6a0AE5_GRPp9OibRjFO-bbNvWQfFJF3c_xRNFgwZL3ecwW6ClHZN6RZl_r4AcZ60KCSqJboFY/?imgmax=800&quot; style=&quot;border-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;406&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;This will create a silverlight project and a Web project in the solution.&lt;/div&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;/div&gt;&lt;ul style=&quot;font-family: inherit;&quot;&gt;&lt;li&gt;Right Click the solution and Add a New WCF Service Application, &lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhR_RvlYylEwbixBJ7qMJ-WIDGCiOQEX3OwR_zL9l6r1V_wp2Do_LuaL4jS5QYp2-SJooMXeHWIyN12CiBYZ94qEaV0jDblN2V4_rEOLxielpBJTtjsqRzAjkQEPeXBZxFsNE2HSz1mSGU/s1600-h/image%5B5%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;341&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFVgCJEVUj72P8ADn4odaUXo40BKoB_z5vA7fEmyX2f2369HEu2JRgI9V7QluLxVF-SdRgL0l6O04qK9ZAKVy-qb4oTGyaAQtesZnMv9jFgYk7ks9K40TpwwE20xBy213mTECoC-lKikM/?imgmax=800&quot; style=&quot;border-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;516&quot; /&gt;&lt;/a&gt; &lt;/blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;ul style=&quot;font-family: inherit;&quot;&gt;&lt;li&gt;Create service methods in the WCF Service Application. &lt;/li&gt;
&lt;li&gt;Add Service Reference to the Silverlight application by right clicking it and select Add Service Reference. &lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjt5tHBvIE2WQoeRiOg9GBXDAA0QnqRJDA-raNrtZrUuIeXVHxZX4j5fM46vdOTedgw6WhmUV3AeD99axGDiiamR8-vGujliKPWEYfmWsuC9-wA9_RAiHFAacpU1FFsSG78Gpzp_KfZFXc/s1600-h/image%5B24%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;414&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisxWkvvxYF-5RN7PRswjAXZXgae7Yc8V2q50DBYLlQFwht1iE3q8ngLEyVfVCnOtNBe4OyvmCloMBdkbiY3H8TYaQ40XW7yvFegJ_PJFM_X9IsWeiX0zUL0FdHGNeRbrk0V1nL9yVEL48/?imgmax=800&quot; style=&quot;border-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;508&quot; /&gt;&lt;/a&gt; &lt;/blockquote&gt;&lt;ul&gt;&lt;ul style=&quot;font-family: inherit;&quot;&gt;&lt;li&gt;Add crossdomain.xml file to the WCF Service Project for enabling silverlight application to access the WCF Service.If WCF service is hosted in a web application then add policy file to the web application.&lt;/li&gt;
&lt;li&gt;Try to access the service methods in silverlight application using the service reference added. &lt;/li&gt;
&lt;li&gt;Download Silverlight &amp;amp; WCF Service Sample Application.If you get any run time errors for the sample application then delete  and add the service reference again in the silverlight project. &lt;/li&gt;
&lt;iframe frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://cid-351bd96abe8dc097.skydrive.live.com/embedicon.aspx/CodeNet/SilverlightWithWCF.zip&quot; style=&quot;background-color: #fcfcfc; height: 115px; padding: 0pt; width: 98px;&quot; title=&quot;Preview&quot;&gt;&lt;/iframe&gt; &lt;/ul&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
Another sample application - &lt;a href=&quot;http://codepronet.blogspot.com/2010/05/silverlight-rss-reader.html&quot;&gt;A Silverlight RSS Reader&lt;/a&gt;</description><link>http://codepronet.blogspot.com/2009/07/silverlight-with-wcf-service.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE-PTIBZrN7oEYpE9lZceYtpqXoXf-lGF5EOK9nYfSSVdALM-mN5_tGPQVLoDhaYpZ7SfqygS35uLPDhtm3RxSa2MrC0s65YtqLGOL5WWiqL1Z0WnIuOpaAEg_6IHNrLhF571njCJkM9s/s72-c?imgmax=800" height="72" width="72"/><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7209751425484679379.post-1447533385728297560</guid><pubDate>Thu, 23 Jul 2009 07:06:00 +0000</pubDate><atom:updated>2010-05-28T13:10:52.058+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Microsoft</category><title>Microsoft Tag Reader</title><description>&lt;div style=&quot;font-family: inherit;&quot;&gt;Today i installed Microsoft Tag Reader in my Mobile - N73 Symbian S60 3rd Edition.Application will decode a tag printed some where by using the mobile camera and also open the related web content.&lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;a href=&quot;http://gettag.mobi/&quot; target=&quot;_blank&quot;&gt;Download Tag Reader&lt;/a&gt; for your mobile and try it out.Its cool.&lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;a href=&quot;http://www.microsoft.com/tag/&quot; target=&quot;_blank&quot;&gt;Learn More About Microsoft Tag&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;a href=&quot;http://blogs.msdn.com/tag/default.aspx&quot; target=&quot;_blank&quot;&gt;MSDN Blog for More Information on Microsoft Tag and WebService API&lt;/a&gt;&lt;/div&gt;</description><link>http://codepronet.blogspot.com/2009/07/microsoft-tag-reader.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7209751425484679379.post-1526175166239861644</guid><pubDate>Thu, 23 Jul 2009 06:59:00 +0000</pubDate><atom:updated>2010-05-28T13:11:06.164+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">Silverlight</category><title>Silverlight 3 Features</title><description>&lt;div style=&quot;font-family: inherit;&quot;&gt;Download &lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?familyid=9442b0f2-7465-417a-88f3-5e7b5409e9dd&amp;amp;displaylang=en&quot; target=&quot;_blank&quot;&gt;Silverlight 3 Tools for Visual Studio 2008 Sp1&lt;/a&gt;.&lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;Resources for Silverlight 3 , &lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;a href=&quot;http://silverlight.net/getstarted/&quot; target=&quot;_blank&quot;&gt;Get Started&lt;/a&gt;.&lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;a href=&quot;http://silverlight.net/getstarted/silverlight3/default.aspx&quot; target=&quot;_blank&quot;&gt;What’s New in Silverlight 3?&lt;/a&gt;&lt;/div&gt;</description><link>http://codepronet.blogspot.com/2009/07/silverlight-3-features.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7209751425484679379.post-8481646653388049060</guid><pubDate>Mon, 29 Jun 2009 10:54:00 +0000</pubDate><atom:updated>2010-05-28T13:11:20.556+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">LINQ</category><title>Immediate Loading Relational Data in LINQ to SQL</title><description>&lt;div style=&quot;font-family: inherit;&quot;&gt;In LINQ to SQL the relational data is loading only when we refer that data, other terms its lazy loading of data.But we can load relational data ,suppose we have an Employee Table and also having an Employee details table related to Employee Table, we can load that relational data using &lt;span style=&quot;color: #2b91af;&quot;&gt;DataLoadOptions &lt;/span&gt;while querying the context.&lt;/div&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;DataLoadOptions &lt;/span&gt;options = &lt;span style=&quot;color: blue;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;DataLoadOptions&lt;/span&gt;();
options.AssociateWith&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Employee&lt;/span&gt;&amp;gt;(p =&amp;gt; p.EmployeeDetails.
Where(q =&amp;gt; q.IsActive == &lt;span style=&quot;color: blue;&quot;&gt;false&lt;/span&gt;));
options.LoadWith&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Employee&lt;/span&gt;&amp;gt;(p =&amp;gt; p.EmployeeDetails);
Context.LoadOptions = options;&lt;/pre&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;var emp = from &lt;/span&gt;p &lt;span style=&quot;color: blue;&quot;&gt;in &lt;/span&gt;DataContext.&lt;span style=&quot;color: #2b91af;&quot;&gt;Employee&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;where &lt;/span&gt;p.EmployeeID == employeeID &amp;amp;&amp;amp;
p.IsDeleted == &lt;span style=&quot;color: blue;&quot;&gt;false
select &lt;/span&gt;p&lt;/pre&gt;&lt;br /&gt;
&lt;a href=&quot;http://11011.net/software/vspaste&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://11011.net/software/vspaste&quot;&gt;&lt;/a&gt;</description><link>http://codepronet.blogspot.com/2009/06/immediate-loading-relational-data-in.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7209751425484679379.post-6518825742627046691</guid><pubDate>Thu, 28 May 2009 06:02:00 +0000</pubDate><atom:updated>2010-05-28T13:11:35.850+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">Microsoft Surface</category><title>Microsoft Surface Videos</title><description>&lt;div style=&quot;font-family: inherit;&quot;&gt;Watch some cool Microsoft Surface Videos &lt;a href=&quot;http://www.microsoft.com/surface/Default.aspx?page=videos#gid=demos&amp;amp;vid=n1&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;Hope you’ll enjoy.&lt;/div&gt;</description><link>http://codepronet.blogspot.com/2009/05/microsoft-surface-videos.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7209751425484679379.post-2469012061500548477</guid><pubDate>Wed, 27 May 2009 05:04:00 +0000</pubDate><atom:updated>2010-05-28T13:11:50.710+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">Ajax</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET 2.0</category><category domain="http://www.blogger.com/atom/ns#">JavaScript</category><title>AjaxControlToolkit New Version</title><description>&lt;div style=&quot;font-family: inherit;&quot;&gt;AjaxControlToolkit version 3.0.30512 is released with&amp;nbsp; 3 new controls,&lt;/div&gt;&lt;ul style=&quot;font-family: inherit;&quot;&gt;&lt;li&gt;HTMLEditor&lt;/li&gt;
&lt;li&gt;ComboBox&lt;/li&gt;
&lt;li&gt;ColorPicker&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;Download &lt;a href=&quot;http://ajaxcontroltoolkit.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=27326&quot; target=&quot;_blank&quot;&gt;AjaxControlToolkit&lt;/a&gt;&lt;/div&gt;</description><link>http://codepronet.blogspot.com/2009/05/ajaxcontroltoolkit-new-version.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7209751425484679379.post-1088197885829693608</guid><pubDate>Fri, 22 May 2009 06:17:00 +0000</pubDate><atom:updated>2010-05-28T13:12:06.046+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><title>Visual Studio 2010 Professional Beta 1</title><description>&lt;div style=&quot;font-family: inherit;&quot;&gt;Finally here comes what we’ve been waiting.Next Generation of Visual Studio is on move.Visual Studio 2010 Professional Beta 1 is now available for Download.&lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyID=75cbcbcd-b0e8-40ea-adae-85714e8984e3&amp;amp;displaylang=en&quot; target=&quot;_blank&quot;&gt;Visual Studio 2010 Professional Beta 1&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;Enjoy&lt;/div&gt;</description><link>http://codepronet.blogspot.com/2009/05/visual-studio-2010-professional-beta-1.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7209751425484679379.post-1013331463348280444</guid><pubDate>Tue, 19 May 2009 06:40:00 +0000</pubDate><atom:updated>2009-05-19T12:15:41.771+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">Microsoft Surface</category><category domain="http://www.blogger.com/atom/ns#">WPF</category><title>ElementMenu in Microsoft Surface</title><description>&lt;p&gt;Microsoft Surface 1.0 SP1 introduced a new control named ElementMenu.ElementMenu in surface SDK provides you a new way to display the data in a new hierarchical manner.ElementMenu implementing SurfaceItemsControl and its a collection of ElementMenuItem.I created a sample application using this ElementMenu just to checking out how its looking.Of course its pretty cool.&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style=&quot;margin: 0px; padding: 0px; display: inline; float: none;&quot; id=&quot;scid:8747F07C-CDE8-481f-B0DF-C6CFD074BF67:b4afe3d4-ea68-4961-adbf-46f060aa22e9&quot; class=&quot;wlWriterEditableSmartContent&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_I5HccIIfHaD7TQ2QpKzQhFNQ5IyVpIrY3W-y3jqgL0S6ddO2XDGZ74xNrtBuqlJI13j2HR5dLIQRw0v-Vd4OMAavWWnVNCw_v80luMgBrqrL9BOjeq2y6ZB1VhnAI94yE0JhovIFS-Y/?imgmax=800&quot; title=&quot;ElementMenu in Surface Simulator&quot; rel=&quot;thumbnail&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWMgnV5r7R0FFk3gE3h0pkS0cZxcMtVgp603g7UoNkb4mbcSa4jG1eVPi6ExLfQbAM4WwTnYfu0UYHgYLZJV3XQIBnkozN3OTzdI32pj8vzTqDBjnVkoEphKKttMMsggYeJzLm51OzDGM/?imgmax=800&quot; border=&quot;0&quot; height=&quot;484&quot; width=&quot;580&quot; /&gt;&lt;/a&gt;&lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Create a Surface Project.In surfaceWindow1 add ElementMenu Control from Toolbox. &lt;br /&gt;&lt;span style=&quot;color:blue;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&lt;/span&gt;&lt;/p&gt;  &lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;ElementMenu &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;MainMenu&quot;&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;gt;&lt;br /&gt;           &lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;       &lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;ElementMenu&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;Add child ElementMenuItem controls.&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;ElementMenu &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;MainMenu&quot;&lt;br /&gt;             &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;VerticalAlignment&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;Bottom&quot;&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;gt;&lt;br /&gt;  &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;ElementMenuItem &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Header&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;Honda&quot;&amp;gt;&lt;br /&gt;      &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;ElementMenuItem &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;MenuItem1&quot;&lt;br /&gt;                         &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Header&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;Civic&quot;&lt;br /&gt;                         &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Click&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;MenuItem1_Click&quot; /&amp;gt;&lt;br /&gt;      &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;ElementMenuItem &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Header&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;CRV&quot;&lt;br /&gt;        &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Command&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;local:SurfaceWindow1.MenuItemCommand&quot; /&amp;gt;&lt;br /&gt;       &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;ElementMenuItem &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Header&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;City&quot;&lt;br /&gt;                          &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Click&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;MenuItem1_Click&quot; /&amp;gt;&lt;br /&gt;       &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;ElementMenuItem &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Header&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;Accord&quot;&lt;br /&gt;        &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Command&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;local:SurfaceWindow1.MenuItemCommand&quot; /&amp;gt;&lt;br /&gt;   &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;ElementMenuItem&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;gt;          &lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;ElementMenu&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-family:Georgia;&quot;&gt;Here i added two levels of ElementMenuItem for the ElementMenu.We can handle the click event by either using Click Event handler or using Command.Here i am using both for different Element Menu Items.Using Click Event handler is straight forward.But if we are using command first create a RoutedCommand in the code behind,&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color:blue;&quot;&gt;public static readonly &lt;/span&gt;&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;RoutedCommand &lt;/span&gt;MenuItemCommand = &lt;span style=&quot;color:blue;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;RoutedCommand&lt;/span&gt;();&lt;/pre&gt;Then add this command to the Window’s CommandBindings.Here am using XAML for adding the command to the command collection,&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;Window.CommandBindings&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;gt;&lt;br /&gt;  &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;CommandBinding &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Command&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;local:SurfaceWindow1.MenuItemCommand&quot;&lt;br /&gt;                  &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Executed&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;CommandBinding_Executed&quot; /&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;Window.CommandBindings&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;where local is the reference to the current assembly,&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color:red;&quot;&gt;xmlns&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;local&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;clr-namespace:MySurfaceApplication&quot;&lt;/span&gt;&lt;/pre&gt;SurfaceWindow1 is the Class name.Add this command to the Element  Menu Item as in the above code snippet.Add CommandBinding_Executed in the code behind,&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color:blue;&quot;&gt;private void &lt;/span&gt;CommandBinding_Executed(&lt;span style=&quot;color:blue;&quot;&gt;object &lt;/span&gt;sender, &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;ExecutedRoutedEventArgs &lt;/span&gt;e)&lt;br /&gt;{&lt;br /&gt;  CarDetails.Text = (e.OriginalSource &lt;span style=&quot;color:blue;&quot;&gt;as &lt;/span&gt;&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;ElementMenuItem&lt;/span&gt;).Header.ToString();&lt;br /&gt;}&lt;/pre&gt;So now my whole XAML looks like,&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;SurfaceWindow &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Class&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;MySurfaceApplication.SurfaceWindow1&quot;&lt;br /&gt;               &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;xmlns&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;&lt;br /&gt;               &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;xmlns&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;&lt;br /&gt;               &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;xmlns&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;http://schemas.microsoft.com/surface/2008&quot;&lt;br /&gt;               &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;xmlns&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;local&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;clr-namespace:MySurfaceApplication&quot;&lt;br /&gt;               &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Title&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;MySurfaceApplication&quot;&amp;gt;&lt;br /&gt;  &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;Window.CommandBindings&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;gt;&lt;br /&gt;      &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;CommandBinding &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Command&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;local:SurfaceWindow1.MenuItemCommand&quot;&lt;br /&gt;                      &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Executed&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;CommandBinding_Executed&quot; /&amp;gt;&lt;br /&gt;  &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;Window.CommandBindings&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;gt;&lt;br /&gt;&lt;br /&gt;      &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;Grid&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;gt;&lt;br /&gt;          &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;gt;&lt;br /&gt;              &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;RowDefinition &lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;/&amp;gt;&lt;br /&gt;              &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;RowDefinition &lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;/&amp;gt;&lt;br /&gt;          &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;gt;&lt;br /&gt;          &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;TextBlock &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;Comparison&quot;&lt;br /&gt;                     &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Grid.Row&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;0&quot;&lt;br /&gt;                     &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;Car Comparison&quot;&lt;br /&gt;                     &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;VerticalAlignment&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;Bottom&quot;&lt;br /&gt;                     &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;Center&quot;&lt;br /&gt;                     &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Foreground&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;White&quot;&lt;br /&gt;                     &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Background&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;Blue&quot;&amp;gt;&lt;br /&gt;          &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;ElementMenu &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;MainMenu&quot;&lt;br /&gt;                         &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;VerticalAlignment&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;Bottom&quot;&lt;br /&gt;                         &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;ActivationMode&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;HostInteraction&quot;&lt;br /&gt;                         &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;ActivationHost&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;{&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;Binding &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;ElementName&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=Comparison}&quot;&amp;gt;&lt;br /&gt;              &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;ElementMenuItem &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Header&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;Honda&quot;&amp;gt;&lt;br /&gt;                  &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;ElementMenuItem &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;MenuItem1&quot;&lt;br /&gt;                                     &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Header&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;Civic&quot;&lt;br /&gt;                                     &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Click&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;MenuItem1_Click&quot; /&amp;gt;&lt;br /&gt;                  &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;ElementMenuItem &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Header&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;CRV&quot;&lt;br /&gt;                                     &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Command&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;local:SurfaceWindow1.MenuItemCommand&quot; /&amp;gt;&lt;br /&gt;                  &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;ElementMenuItem &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Header&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;City&quot;&lt;br /&gt;                                     &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Click&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;MenuItem1_Click&quot; /&amp;gt;&lt;br /&gt;                  &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;ElementMenuItem &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Header&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;Accord&quot;&lt;br /&gt;                                     &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Command&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;local:SurfaceWindow1.MenuItemCommand&quot; /&amp;gt;&lt;br /&gt;              &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;ElementMenuItem&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;gt;             &lt;br /&gt;          &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;ElementMenu&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;gt;&lt;br /&gt;          &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;TextBlock&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;gt;&lt;br /&gt;          &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;TextBlock &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;CarDetails&quot;&lt;br /&gt;                     &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Height&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;200&quot;&lt;br /&gt;                     &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Width&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;200&quot;&lt;br /&gt;                     &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Grid.Row&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;1&quot;&lt;br /&gt;                     &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;Car Details&quot;&lt;br /&gt;                     &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;VerticalAlignment&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;Center&quot;&lt;br /&gt;                     &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Background&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;DarkRed&quot;&lt;br /&gt;                     &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;Center&quot; /&amp;gt;&lt;br /&gt;      &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;Grid&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;gt;  &lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;SurfaceWindow&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;and code behind like(using directives removed),&lt;br /&gt;&lt;pre class=&quot;code&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color:blue;&quot;&gt;namespace &lt;/span&gt;MySurfaceApplication&lt;br /&gt;{&lt;br /&gt;  &lt;span style=&quot;color:gray;&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;br /&gt;  /// &lt;/span&gt;&lt;span style=&quot;color:green;&quot;&gt;Interaction logic for SurfaceWindow1.xaml&lt;br /&gt;  &lt;/span&gt;&lt;span style=&quot;color:gray;&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;br /&gt;  &lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;public partial class &lt;/span&gt;&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;SurfaceWindow1 &lt;/span&gt;: &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;SurfaceWindow&lt;br /&gt;  &lt;/span&gt;{&lt;br /&gt;      &lt;span style=&quot;color:blue;&quot;&gt;public static readonly &lt;/span&gt;&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;RoutedCommand &lt;/span&gt;MenuItemCommand = &lt;span style=&quot;color:blue;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;RoutedCommand&lt;/span&gt;();&lt;br /&gt;      &lt;span style=&quot;color:gray;&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;br /&gt;      /// &lt;/span&gt;&lt;span style=&quot;color:green;&quot;&gt;Default constructor.&lt;br /&gt;      &lt;/span&gt;&lt;span style=&quot;color:gray;&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;br /&gt;      &lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;public &lt;/span&gt;SurfaceWindow1()&lt;br /&gt;      {&lt;br /&gt;          InitializeComponent();&lt;br /&gt;          &lt;span style=&quot;color:green;&quot;&gt;// Add handlers for Application activation events&lt;br /&gt;          &lt;/span&gt;AddActivationHandlers();       &lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      &lt;span style=&quot;color:gray;&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;br /&gt;      /// &lt;/span&gt;&lt;span style=&quot;color:green;&quot;&gt;Occurs when the window is about to close.&lt;br /&gt;      &lt;/span&gt;&lt;span style=&quot;color:gray;&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;br /&gt;      /// &amp;lt;param name=&quot;e&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;br /&gt;      &lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;protected override void &lt;/span&gt;OnClosed(&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;EventArgs &lt;/span&gt;e)&lt;br /&gt;      {&lt;br /&gt;          &lt;span style=&quot;color:blue;&quot;&gt;base&lt;/span&gt;.OnClosed(e);&lt;br /&gt;&lt;br /&gt;          &lt;span style=&quot;color:green;&quot;&gt;// Remove handlers for Application activation events&lt;br /&gt;          &lt;/span&gt;RemoveActivationHandlers();&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      &lt;span style=&quot;color:gray;&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;br /&gt;      /// &lt;/span&gt;&lt;span style=&quot;color:green;&quot;&gt;Adds handlers for Application activation events.&lt;br /&gt;      &lt;/span&gt;&lt;span style=&quot;color:gray;&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;br /&gt;      &lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;private void &lt;/span&gt;AddActivationHandlers()&lt;br /&gt;      {&lt;br /&gt;          &lt;span style=&quot;color:green;&quot;&gt;// Subscribe to surface application activation events&lt;br /&gt;          &lt;/span&gt;&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;ApplicationLauncher&lt;/span&gt;.ApplicationActivated += OnApplicationActivated;&lt;br /&gt;          &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;ApplicationLauncher&lt;/span&gt;.ApplicationPreviewed += OnApplicationPreviewed;&lt;br /&gt;          &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;ApplicationLauncher&lt;/span&gt;.ApplicationDeactivated += OnApplicationDeactivated;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      &lt;span style=&quot;color:gray;&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;br /&gt;      /// &lt;/span&gt;&lt;span style=&quot;color:green;&quot;&gt;Removes handlers for Application activation events.&lt;br /&gt;      &lt;/span&gt;&lt;span style=&quot;color:gray;&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;br /&gt;      &lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;private void &lt;/span&gt;RemoveActivationHandlers()&lt;br /&gt;      {&lt;br /&gt;          &lt;span style=&quot;color:green;&quot;&gt;// Unsubscribe from surface application activation events&lt;br /&gt;          &lt;/span&gt;&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;ApplicationLauncher&lt;/span&gt;.ApplicationActivated -= OnApplicationActivated;&lt;br /&gt;          &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;ApplicationLauncher&lt;/span&gt;.ApplicationPreviewed -= OnApplicationPreviewed;&lt;br /&gt;          &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;ApplicationLauncher&lt;/span&gt;.ApplicationDeactivated -= OnApplicationDeactivated;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      &lt;span style=&quot;color:gray;&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;br /&gt;      /// &lt;/span&gt;&lt;span style=&quot;color:green;&quot;&gt;This is called when application has been activated.&lt;br /&gt;      &lt;/span&gt;&lt;span style=&quot;color:gray;&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;br /&gt;      /// &amp;lt;param name=&quot;sender&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;br /&gt;      /// &amp;lt;param name=&quot;e&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;br /&gt;      &lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;private void &lt;/span&gt;OnApplicationActivated(&lt;span style=&quot;color:blue;&quot;&gt;object &lt;/span&gt;sender, &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;EventArgs &lt;/span&gt;e)&lt;br /&gt;      {&lt;br /&gt;          &lt;span style=&quot;color:green;&quot;&gt;//TODO: enable audio, animations here&lt;br /&gt;      &lt;/span&gt;}&lt;br /&gt;&lt;br /&gt;      &lt;span style=&quot;color:gray;&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;br /&gt;      /// &lt;/span&gt;&lt;span style=&quot;color:green;&quot;&gt;This is called when application is in preview mode.&lt;br /&gt;      &lt;/span&gt;&lt;span style=&quot;color:gray;&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;br /&gt;      /// &amp;lt;param name=&quot;sender&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;br /&gt;      /// &amp;lt;param name=&quot;e&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;br /&gt;      &lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;private void &lt;/span&gt;OnApplicationPreviewed(&lt;span style=&quot;color:blue;&quot;&gt;object &lt;/span&gt;sender, &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;EventArgs &lt;/span&gt;e)&lt;br /&gt;      {&lt;br /&gt;          &lt;span style=&quot;color:green;&quot;&gt;//TODO: Disable audio here if it is enabled&lt;br /&gt;&lt;br /&gt;          //TODO: optionally enable animations here&lt;br /&gt;      &lt;/span&gt;}&lt;br /&gt;&lt;br /&gt;      &lt;span style=&quot;color:gray;&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;br /&gt;      ///  &lt;/span&gt;&lt;span style=&quot;color:green;&quot;&gt;This is called when application has been deactivated.&lt;br /&gt;      &lt;/span&gt;&lt;span style=&quot;color:gray;&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;br /&gt;      /// &amp;lt;param name=&quot;sender&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;br /&gt;      /// &amp;lt;param name=&quot;e&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;br /&gt;      &lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;private void &lt;/span&gt;OnApplicationDeactivated(&lt;span style=&quot;color:blue;&quot;&gt;object &lt;/span&gt;sender, &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;EventArgs &lt;/span&gt;e)&lt;br /&gt;      {&lt;br /&gt;          &lt;span style=&quot;color:green;&quot;&gt;//TODO: disable audio, animations here&lt;br /&gt;      &lt;/span&gt;}&lt;br /&gt;&lt;br /&gt;      &lt;span style=&quot;color:blue;&quot;&gt;private void &lt;/span&gt;MenuItem1_Click(&lt;span style=&quot;color:blue;&quot;&gt;object &lt;/span&gt;sender, &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;RoutedEventArgs &lt;/span&gt;e)&lt;br /&gt;      {&lt;br /&gt;          CarDetails.Text = (e.OriginalSource &lt;span style=&quot;color:blue;&quot;&gt;as &lt;/span&gt;&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;ElementMenuItem&lt;/span&gt;).Header.ToString();&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      &lt;span style=&quot;color:blue;&quot;&gt;private void &lt;/span&gt;CommandBinding_Executed(&lt;span style=&quot;color:blue;&quot;&gt;object &lt;/span&gt;sender, &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;ExecutedRoutedEventArgs &lt;/span&gt;e)&lt;br /&gt;      {&lt;br /&gt;          CarDetails.Text = (e.OriginalSource &lt;span style=&quot;color:blue;&quot;&gt;as &lt;/span&gt;&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;ElementMenuItem&lt;/span&gt;).Header.ToString();&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;}&lt;/pre&gt;&lt;p&gt; &lt;/p&gt;Build and Run the application.&lt;img alt=&quot;thumbs_up&quot; src=&quot;http://spaces.live.com/rte/emoticons/thumbs_up.gif&quot; /&gt;</description><link>http://codepronet.blogspot.com/2009/05/elementmenu-in-microsoft-surface.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWMgnV5r7R0FFk3gE3h0pkS0cZxcMtVgp603g7UoNkb4mbcSa4jG1eVPi6ExLfQbAM4WwTnYfu0UYHgYLZJV3XQIBnkozN3OTzdI32pj8vzTqDBjnVkoEphKKttMMsggYeJzLm51OzDGM/s72-c?imgmax=800" height="72" width="72"/><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7209751425484679379.post-5265691743772794392</guid><pubDate>Fri, 15 May 2009 08:49:00 +0000</pubDate><atom:updated>2009-09-10T16:58:22.314+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">Microsoft Surface</category><category domain="http://www.blogger.com/atom/ns#">WPF</category><title>Tagged Objects in Microsoft Surface – TagVisualizer,TagVisualization,TagVisualizationDefinition</title><description>&lt;p&gt;Microsoft introduced a new concept called &lt;strong&gt;Tag driven application&lt;/strong&gt; or &lt;strong&gt;Tagged Objects&lt;/strong&gt; in Surface SDK through which the surface can identify Objects placed over the surface table.Object is printed with some tags that surface engine can read.Tags are either &lt;strong&gt;Byte Tags&lt;/strong&gt; or &lt;strong&gt;Identity Tags&lt;/strong&gt;.&lt;/p&gt;  &lt;div style=&quot;margin: 0px; padding: 0px; display: inline; float: none;&quot; id=&quot;scid:8747F07C-CDE8-481f-B0DF-C6CFD074BF67:638c71cf-358d-45a3-a598-d0ad91cca72d&quot; class=&quot;wlWriterEditableSmartContent&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilGNVRrj55XlR3xzaSmfiyvJkVTIXj8u1DNNr2IOicW9h0rG4QwhH2SV9z8ZlUPyxK3XwFMjAqf4JqxxzZ61HlvWns-dvr2Qbj-JIL79wgiTIMrrPEsxwZbLWYU0CZ3N8b6_znS2q5gK0/?imgmax=800&quot; title=&quot;Tagged Object in Simulator&quot; rel=&quot;thumbnail&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWUy9bIt6omBNUnl8qJMi2VwEai2j27gJ40fDtsPsQ3xAA_rEHdtpdgmQ97KPEzoz1S60IH20AgrEGKpUxHsvnviozG3498OKYELlQ0IjsAqucWmAhs-JgkDf2AQHuwtQuzC7gk0nL5xA/?imgmax=800&quot; width=&quot;386&quot; border=&quot;0&quot; height=&quot;372&quot; /&gt;&lt;/a&gt;&lt;/div&gt;  &lt;p&gt;&lt;/p&gt;    &lt;p&gt; How we can achieve this using Surface SDK?Let’s have a look at that.&lt;br /&gt;I tried a sample by using Tagged Objects in Surface SDK.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Tag Visualization is possible by using these three classes,&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;TagVisualizer&lt;/strong&gt; –  is what actually responding to the Tagged Object and showing up the TagVisualization when placing a tag. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;TagVisualization&lt;/strong&gt; - is what we are showing in the surface when a tag is placed in the surface. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;TagVisualizationDefinition&lt;/strong&gt; – is using for defining the tag value to which the TagVisualizer will respond and also source, physical location,orientation and other properties of the visualization. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;So Let’s try a sample.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Create a Surface project from the Visual Studio 2008 Template. &lt;/li&gt;    &lt;li&gt;In the SurfaceWindow1 add a TagVisualizer. &lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;TagVisualizer &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;TagVisualizer&quot;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;TagVisualizer&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;Add a TagVisualization to the project.Add New Item&amp;gt;TagVisualization.I created TagVisualization SampleTagVisualization, &lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;TagVisualization &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Class&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;MySurfaceApplication.SampleTagVisualization&quot;        &lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;xmlns&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;xmlns&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;xmlns&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;http://schemas.microsoft.com/surface/2008&quot;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Loaded&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;SampleTagVisualization_Loaded&quot;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;Grid &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Height&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;400&quot;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Width&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;600&quot;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Background&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;White&quot;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;TextBlock &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;Some Tagged Object UI here.&quot;&lt;br /&gt;        &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;VerticalAlignment&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;Center&quot;&lt;br /&gt;        &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;Center&quot;&lt;br /&gt;        &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Foreground&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;Red&quot; /&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;Grid&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;TagVisualization&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;Add TagVisualizationDefinition to SurfaceWindow1 for TagVisualizer.We can add this either by XAML or from code behind, &lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;p&gt;Either From XAML,&lt;/p&gt;&lt;br /&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;TagVisualizer &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;TagVisualizer&quot;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;TagVisualizer.Definitions&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;ByteTagVisualizationDefinition &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;192&quot;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Source&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;SampleTagVisualization.xaml&quot;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;UsesTagOrientation&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;True&quot;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;TagRemovedBehavior&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;Fade&quot;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;PhysicalCenterOffsetFromTag&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;7.5,4.5&quot;/&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;TagVisualizer.Definitions&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;TagVisualizer&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;or From code behind,(add it in the constructor)&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;ByteTagVisualizationDefinition &lt;/span&gt;tagVisualizationDefinition = &lt;span style=&quot;color:blue;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;&lt;br /&gt;ByteTagVisualizationDefinition&lt;/span&gt;();&lt;br /&gt;tagVisualizationDefinition.Value = 192;&lt;br /&gt;tagVisualizationDefinition.Source = &lt;span style=&quot;color:blue;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Uri&lt;/span&gt;(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;SampleTagVisualization.xaml&quot;&lt;/span&gt;,&lt;br /&gt;&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;UriKind&lt;/span&gt;.Relative);&lt;br /&gt;tagVisualizationDefinition.UsesTagOrientation = &lt;span style=&quot;color:blue;&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;tagVisualizationDefinition.TagRemovedBehavior = &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;TagRemovedBehavior&lt;/span&gt;.Fade;&lt;br /&gt;tagVisualizationDefinition.PhysicalCenterOffsetFromTag = &lt;span style=&quot;color:blue;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;&lt;br /&gt;Vector&lt;/span&gt;(7.5, 4.5);&lt;br /&gt;TagVisualizer.Definitions.Add(tagVisualizationDefinition);&lt;/pre&gt;Build and Run the application in Surface Simulator.Tag Value is here 192.So give Tag Value as &lt;strong&gt;C0 &lt;/strong&gt;(Hexadecimal).&lt;br /&gt;&lt;/blockquote&gt;</description><link>http://codepronet.blogspot.com/2009/05/tagged-objects-in-microsoft-surface.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWUy9bIt6omBNUnl8qJMi2VwEai2j27gJ40fDtsPsQ3xAA_rEHdtpdgmQ97KPEzoz1S60IH20AgrEGKpUxHsvnviozG3498OKYELlQ0IjsAqucWmAhs-JgkDf2AQHuwtQuzC7gk0nL5xA/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7209751425484679379.post-7031808733257986973</guid><pubDate>Thu, 30 Apr 2009 13:18:00 +0000</pubDate><atom:updated>2009-09-10T10:36:57.914+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">Microsoft Surface</category><category domain="http://www.blogger.com/atom/ns#">WPF</category><title>ScatterView in Microsoft Surface SDK</title><description>&lt;blockquote&gt;   &lt;p&gt;Microsoft SDK provides a control named ScatterView which acts like a container and we can move,resize or rotate the object which is placed inside the ScatterView Container.There is no need to create events or code for doing this.ScatterView will automatically handle all the Events.Definitely users will find this as a very cool feature.I created my first Surface application with ScatterView.Its pretty simple doing this and of course cool.&lt;/p&gt;    &lt;ul&gt;     &lt;li&gt;Create a Surface Project from Visual Studio Template.&lt;/li&gt;      &lt;li&gt;Add ScatterView Control.&lt;/li&gt;   &lt;/ul&gt;    &lt;p&gt;ScatterView contains collection of ScatterViewItem.Add Objects to ScatterView either inside a ScatterViewItem or we can directly add objects to the ScatterView.&lt;/p&gt;    &lt;p&gt;The ScatterView looks either like,&lt;/p&gt;    &lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;s:ScatterView&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;     &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;s:ScatterViewItem&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;200&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Height&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;200&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Center&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;500,300&quot;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;attr&quot;&gt;Orientation&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;315&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;         &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Image&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Source&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Images/Forest.jpg&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Stretch&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Fill&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Image&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;s:ScatterViewItem&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;s:ScatterView&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;OR like,&lt;br /&gt;&lt;br /&gt; &lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;s:ScatterView&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Image&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Source&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Images/Forest.jpg&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Stretch&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Fill&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Image&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;s:ScatterView&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt; &lt;style type=&quot;text/css&quot;&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt; font-size: small;&lt;br /&gt; color: black;&lt;br /&gt; font-family: consolas, &quot;Courier New&quot;, courier, monospace;&lt;br /&gt; background-color: #ffffff;&lt;br /&gt; /*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt; background-color: #f4f4f4;&lt;br /&gt; width: 100%;&lt;br /&gt; margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;I am adding an Image to the ScatterView so that we can manipulate like resize,rotate or move the image.&lt;br /&gt;&lt;br /&gt; &lt;div style=&quot;margin: 0px; padding: 0px; display: inline; float: none;&quot; id=&quot;scid:8747F07C-CDE8-481f-B0DF-C6CFD074BF67:74d4c33a-0adf-40a7-a82c-651b147c426c&quot; class=&quot;wlWriterEditableSmartContent&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgG0aW0F67F6fZZWiJTiUBcoSrMP7ICCIEk-Ka4iABQClyldeX7ds3TDj0XiAGvqpKju51jCQcfsh3WoN-ruhEjTJhyeSYP0tZeR-DIUI5Vso7Z5aPYYblDZI3QxZfLfYvXBkd7phNYQXI/?imgmax=800&quot; title=&quot;Resize Image Using Two Fingers&quot; rel=&quot;thumbnail&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL5_RoXpfpkLxnTOpCfkcaskMtLnFceUnTJtxkZuCEJ-J_fO8BKq17fxfKzPv3viM5PynndD5KUmbsLfMpfWvC7t-a0HZfNUXWFsqlAK8E73AQo0Qf8zL1gokrXsH29kNbZUzDT5_gYCM/?imgmax=800&quot; border=&quot;0&quot; height=&quot;372&quot; width=&quot;386&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&lt;/span&gt;&lt;/pre&gt;</description><link>http://codepronet.blogspot.com/2009/04/scatterview-in-microsoft-surface-sdk.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL5_RoXpfpkLxnTOpCfkcaskMtLnFceUnTJtxkZuCEJ-J_fO8BKq17fxfKzPv3viM5PynndD5KUmbsLfMpfWvC7t-a0HZfNUXWFsqlAK8E73AQo0Qf8zL1gokrXsH29kNbZUzDT5_gYCM/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7209751425484679379.post-1305765653334392567</guid><pubDate>Mon, 27 Apr 2009 12:16:00 +0000</pubDate><atom:updated>2009-05-07T15:06:04.420+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">WPF</category><title>IValueConverter in WPF</title><description>&lt;p&gt;Converters are mainly using in WPF when there is a need to convert a value to another value just like converting a Boolean to Visibility.&lt;/p&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; CustomConverter : IValueConverter&lt;br /&gt;  {&lt;br /&gt;      &lt;span class=&quot;preproc&quot;&gt;#region&lt;/span&gt; IValueConverter Members&lt;br /&gt;&lt;br /&gt;      &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; Convert(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt;, Type targetType, &lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; parameter,&lt;br /&gt;CultureInfo culture)&lt;br /&gt;      {&lt;br /&gt;          &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt; ==&lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;)&lt;br /&gt;              &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;          &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; ConvertBack(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt;, Type targetType, &lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; parameter,&lt;br /&gt;CultureInfo culture)&lt;br /&gt;      {&lt;br /&gt;          &lt;span class=&quot;kwrd&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; NotImplementedException();&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      &lt;span class=&quot;preproc&quot;&gt;#endregion&lt;/span&gt;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;Here CustomConverter is implementing IValueConverter.We can use this converter in the XAML.First add this Converter in the resources,&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;local&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;:CustomConverter&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Key&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;CustomConverter&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span style=&quot;font-family:Georgia;&quot;&gt;where local is the reference to the assembly where CustomConverter is defined.&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span style=&quot;font-family:Georgia;&quot;&gt;Use this Converter in Controls DataBinding like,&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;html&quot;&gt;IsEnabled&lt;/span&gt;=&quot;{Binding ElementName=ListBoxName, Path=SelectedItem,&lt;br /&gt;Converter={StaticResource &lt;span class=&quot;html&quot;&gt;CustomConverter&lt;/span&gt;}}&quot;&lt;/pre&gt;&lt;style type=&quot;text/css&quot;&gt;csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt; font-size: small;&lt;br /&gt; color: black;&lt;br /&gt; font-family: consolas, &quot;Courier New&quot;, courier, monospace;&lt;br /&gt; background-color: #ffffff;&lt;br /&gt; /*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt; background-color: #f4f4f4;&lt;br /&gt; width: 100%;&lt;br /&gt; margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;style type=&quot;text/css&quot;&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt; font-size: small;&lt;br /&gt; color: black;&lt;br /&gt; font-family: consolas, &quot;Courier New&quot;, courier, monospace;&lt;br /&gt; background-color: #ffffff;&lt;br /&gt; /*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt; background-color: #f4f4f4;&lt;br /&gt; width: 100%;&lt;br /&gt; margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;</description><link>http://codepronet.blogspot.com/2009/04/ivalueconverter-in-wpf.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7209751425484679379.post-2149721508503228174</guid><pubDate>Fri, 20 Mar 2009 04:31:00 +0000</pubDate><atom:updated>2009-03-20T10:01:26.159+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">Silverlight</category><title>First Look – Microsoft Silverlight 3</title><description>&lt;iframe style=&quot;border-right: #dde5e9 1px solid; padding-right: 0px; border-top: #dde5e9 1px solid; padding-left: 0px; padding-bottom: 0px; margin: 3px; border-left: #dde5e9 1px solid; width: 240px; padding-top: 0px; border-bottom: #dde5e9 1px solid; height: 66px; background-color: #ffffff&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; src=&quot;http://cid-5a051e94bda12163.skydrive.live.com/embedrowdetail.aspx/First%20Look%20Microsoft%20Silverlight%203/First%20Look--Microsoft%20Silverlight%203.0.pdf&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot;&gt;&lt;/iframe&gt;  </description><link>http://codepronet.blogspot.com/2009/03/first-look-microsoft-silverlight-3.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7209751425484679379.post-4217492946825493463</guid><pubDate>Wed, 11 Mar 2009 08:49:00 +0000</pubDate><atom:updated>2010-07-13T12:04:13.402+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">WCF</category><title>WCF Tutorial</title><description>&lt;div style=&quot;font-family: courier new;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;font-size: 100%;&quot;&gt;WCF concepts include ABC i.e.,&lt;/span&gt;&lt;/div&gt;&lt;ul style=&quot;font-family: courier new;&quot;&gt;&lt;li&gt;&lt;span style=&quot;font-size: 100%;&quot;&gt;A - Address&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: 100%;&quot;&gt;B - Binding&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: 100%;&quot;&gt;C – Contract&lt;/span&gt; &lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;font-size: 100%;&quot;&gt;Services are building on windows communication foundation’s &lt;i&gt;System.ServiceModel&lt;/i&gt; assembly in location       &lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;font-size: 100%;&quot;&gt;C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 100%;&quot;&gt;You can find some sample applications in some of my articles. Samples consist of a WCF service and a silverlight client that consumes the service. You&#39;ll get a basic concept of WCF from those samples.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 100%;&quot;&gt;Download Sample Application, &lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-size: 100%;&quot;&gt;&lt;a href=&quot;http://codepronet.blogspot.com/2009/07/silverlight-with-wcf-service.html&quot;&gt;Silverlight &amp;amp; WCF Service&lt;/a&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: 100%;&quot;&gt;&lt;a href=&quot;http://codepronet.blogspot.com/2010/05/silverlight-rss-reader.html&quot;&gt;A Silverlight RSS Reader&amp;nbsp;&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;font-size: 100%;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;font-size: 100%;&quot;&gt;You&#39;ll get more samples from MSDN, &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms752239.aspx&quot;&gt;Download Samples&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;font-size: 100%;&quot;&gt;&lt;a href=&quot;http://aspnetcs.blogspot.com/search/label/WCF&quot; target=&quot;_blank&quot;&gt;&lt;br /&gt;
&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;font-size: 100%;&quot;&gt;MSDN Tutorials for WCF,&lt;/span&gt;&lt;/div&gt;&lt;h4 style=&quot;font-family: courier new;&quot;&gt;&lt;/h4&gt;&lt;dl style=&quot;font-family: courier new;&quot;&gt;&lt;dt&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms731835.aspx&quot; target=&quot;_blank&quot;&gt;How to: Define a Windows Communication Foundation Service Contract&lt;/a&gt;&lt;/span&gt;&lt;/dt&gt;
&lt;/dl&gt;&lt;dl style=&quot;font-family: courier new;&quot;&gt;&lt;dt&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms734686.aspx&quot; target=&quot;_blank&quot;&gt;How to: Implement a Windows Communication Foundation Service Contract&lt;/a&gt;&lt;/span&gt;&lt;/dt&gt;
&lt;/dl&gt;&lt;dl style=&quot;font-family: courier new;&quot;&gt;&lt;dt&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms730935.aspx&quot; target=&quot;_blank&quot;&gt;How to: Host and Run a Basic Windows Communication Foundation Service&lt;/a&gt;&lt;/span&gt;&lt;/dt&gt;
&lt;/dl&gt;&lt;dl style=&quot;font-family: courier new;&quot;&gt;&lt;dt&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms733133.aspx&quot; target=&quot;_blank&quot;&gt;How to: Create a Windows Communication Foundation Client&lt;/a&gt;&lt;/span&gt;&lt;/dt&gt;
&lt;/dl&gt;&lt;dl style=&quot;font-family: courier new;&quot;&gt;&lt;dt&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms734663.aspx&quot; target=&quot;_blank&quot;&gt;How to: Configure a Basic Windows Communication Foundation Client&lt;/a&gt;&lt;/span&gt;&lt;/dt&gt;
&lt;/dl&gt;&lt;dl style=&quot;font-family: courier new;&quot;&gt;&lt;dt&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms730144.aspx&quot; target=&quot;_blank&quot;&gt;How to: Use a Windows Communication Foundation Client&lt;/a&gt;&lt;/span&gt;&lt;/dt&gt;
&lt;/dl&gt;</description><link>http://codepronet.blogspot.com/2009/03/wcf-tutorial.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>4</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7209751425484679379.post-3888446909924809277</guid><pubDate>Tue, 10 Mar 2009 04:53:00 +0000</pubDate><atom:updated>2010-08-04T16:06:23.063+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">WPF</category><title>Remove Binding in WPF code-behind</title><description>We can remove binding from a dependency property of a dependency object from code behind using,&lt;br /&gt;
&lt;pre&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;BindingOperations&lt;/span&gt;.ClearBinding(sliderRange, &lt;span style=&quot;color: #2b91af;&quot;&gt;Slider&lt;/span&gt;.ValueProperty);
&lt;/pre&gt;In this snippet, we are removing binding from Value Property of Slider sliderRange.</description><link>http://codepronet.blogspot.com/2009/03/remove-binding-in-wpf-code-behind.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7209751425484679379.post-4748782572198826493</guid><pubDate>Mon, 02 Mar 2009 12:08:00 +0000</pubDate><atom:updated>2009-09-10T10:39:21.106+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET 2.0</category><title>Tag Mapping in ASP.NET</title><description>&lt;p style=&quot;font-family: courier new;&quot;&gt;Tag mapping is using for mapping two controls of compatible type so that it&#39;ll map to the mapped control.Suppose we are creating a custom panel having some custom functionality like,&lt;/p&gt;  &lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; CustomPanel : Panel&lt;br /&gt;{&lt;br /&gt;    &lt;span class=&quot;rem&quot;&gt;//Code here//&lt;/span&gt;&lt;br /&gt;}&lt;/pre&gt;&lt;style type=&quot;text/css&quot;&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt; font-size: small;&lt;br /&gt; color: black;&lt;br /&gt; font-family: consolas, &quot;Courier New&quot;, courier, monospace;&lt;br /&gt; background-color: #ffffff;&lt;br /&gt; /*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt; background-color: #f4f4f4;&lt;br /&gt; width: 100%;&lt;br /&gt; margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;Now we can map all panels to our custom panel so that normal panel will get functionality of custom panel.In web.config,&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;pages&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt; &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tagMapping&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;  &lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;clear&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;  &lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;add&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;tagType&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;System.Web.UI.WebControls.Panel&quot;&lt;/span&gt;&lt;br /&gt;                &lt;span class=&quot;attr&quot;&gt;mappedTagType&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;CustomPanel&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt; &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tagMapping&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;pages&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;</description><link>http://codepronet.blogspot.com/2009/03/tag-mapping-in-aspnet.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7209751425484679379.post-4081560365133134855</guid><pubDate>Sun, 01 Mar 2009 03:30:00 +0000</pubDate><atom:updated>2009-09-10T10:39:21.107+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET 2.0</category><title>Image &amp; Sound in Validator Controls</title><description>&lt;span style=&quot;font-family:courier new;&quot;&gt;I am going to give code snippets for a very interesting trick.ie,to display image or sound instead of validation message in ASP.NET Validation controls.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;Displaying image&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&amp;lt;asp:requiredfieldvalidator id=&quot;reqPercentage&quot; runat=&quot;server&quot; errormessage=&#39;&amp;lt;img src=&quot;image.gif&quot;&amp;gt;&#39; controltovalidate=&quot;txtPercentage&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;       &amp;lt;/asp:requiredfieldvalidator&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;for displaying image instead of text we are giving an img tag with src set to a image in our application.so when validation is failed it&#39;ll show image instead of text.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;Sound in Validation Control&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&amp;lt;asp:requiredfieldvalidator id=&quot;reqPercentage&quot; runat=&quot;server&quot;&lt;br /&gt;errormessage=&#39;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;bgsound src=&quot;sound.wav&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&amp;gt;&#39; controltovalidate=&quot;txtPercentage&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;       &amp;lt;/asp:requiredfieldvalidator&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;And also disable client side script for textbox.Run the application yo&#39;ll see the change.&lt;/span&gt;</description><link>http://codepronet.blogspot.com/2009/03/image-sound-in-validator-controls.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item></channel></rss>