<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Namita's blog on Windows Presentation Foundation</title><subtitle type="html" /><id>http://blogs.msdn.com/namitag/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/namitag/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/namitag/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2005-09-08T18:58:00Z</updated><entry><title>Updated PDC samples</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/namitag/archive/2006/04/07/Namita.aspx" /><link rel="enclosure" type="application/x-zip-compressed" length="3276945" href="http://blogs.msdn.com/namitag/attachment/571206.ashx" /><id>http://blogs.msdn.com/namitag/archive/2006/04/07/Namita.aspx</id><published>2006-04-08T01:46:00Z</published><updated>2006-04-08T01:46:00Z</updated><content type="html">Here are the updated samples on popular demand.&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=571206" width="1" height="1"&gt;</content><author><name>Namitag</name><uri>http://blogs.msdn.com/members/Namitag.aspx</uri></author></entry><entry><title>Binding to properties on the Window</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/namitag/archive/2005/09/22/473050.aspx" /><id>http://blogs.msdn.com/namitag/archive/2005/09/22/473050.aspx</id><published>2005-09-23T02:59:00Z</published><updated>2005-09-23T02:59:00Z</updated><content type="html">&lt;P&gt;I just got a question from someone who wanted to bind to properties on his Window class in his code behind and assumed that by simply saying &amp;lt;Binding Path="MyProperty"/&amp;gt; the Binding will automatically refer to the Window class. It is important to note that by default the Binding bind to properties on the DataContext of that element and not to those of the Window file.&lt;/P&gt;
&lt;P&gt;So the right way to bind to properties on the Window is &lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&amp;lt;Window x:Class="demo.Window1" &lt;BR&gt;xmlns=&lt;A href="http://schemas.microsoft.com/winfx/avalon/2005"&gt;http://schemas.microsoft.com/winfx/avalon/2005&lt;/A&gt;&lt;BR&gt;xmlns:x=&lt;A href="http://schemas.microsoft.com/winfx/xaml/2005"&gt;http://schemas.microsoft.com/winfx/xaml/2005&lt;/A&gt;&lt;BR&gt;Title="demo"&lt;BR&gt;&lt;B&gt;x:Name="window"&lt;/B&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Grid x:Name="myGrid"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;TextBlock Text="{Binding &lt;B&gt;ElementName=window&lt;/B&gt;, Path=SimpleProperty}"/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/Grid&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/Window&amp;gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;or by setting the DataContext to the Window.&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&amp;lt;Window x:Class="demo.Window1" &lt;BR&gt;xmlns=&lt;A href="http://schemas.microsoft.com/winfx/avalon/2005"&gt;http://schemas.microsoft.com/winfx/avalon/2005&lt;/A&gt;&lt;BR&gt;xmlns:x=&lt;A href="http://schemas.microsoft.com/winfx/xaml/2005"&gt;http://schemas.microsoft.com/winfx/xaml/2005&lt;/A&gt;&lt;BR&gt;Title="demo"&lt;BR&gt;&lt;B&gt;x:Name="window"&lt;/B&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Grid x:Name="myGrid"&lt;STRONG&gt; DataContext="{Binding ElementName=window}"&lt;/STRONG&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;TextBlock Text="{Binding Path=SimpleProperty}"/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/Grid&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/Window&amp;gt;&lt;/P&gt;
&lt;P&gt;Infact, ElementName property on Binding lets you refer to any element in the current namescope and bind to properties on it. Now let me explain namescope since i've introduced it. A NameScope defines a scope in which you can only have one element with a specific unique name, and from which you can Find any element via name uniquely. A Page is one such scope, a Template and a Style is another scope. So from within a Template you can only refer to elements in that Template, similarly from within a Page you can only refer to elements in that page.&lt;/P&gt;
&lt;P&gt;- Namita&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;BR&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=473050" width="1" height="1"&gt;</content><author><name>Namitag</name><uri>http://blogs.msdn.com/members/Namitag.aspx</uri></author></entry><entry><title>My PDC Presentation - slides and demos</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/namitag/archive/2005/09/21/472461.aspx" /><id>http://blogs.msdn.com/namitag/archive/2005/09/21/472461.aspx</id><published>2005-09-21T22:28:00Z</published><updated>2005-09-21T22:28:00Z</updated><content type="html">&lt;P&gt;As promised i'm posting my slides as well as demos from my talk PRS324 - Using Data in WPF applications.&lt;/P&gt;
&lt;P&gt;You can access my presentation at&amp;nbsp;&amp;nbsp;&lt;A href="http://216.55.183.63/Pdc2005/slides/PRS324_Gupta.ppt"&gt; PRS324&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;My&amp;nbsp;1st demo built up to show&amp;nbsp;&amp;nbsp;singular Binding, list binding, DataTemplate, CollectionView/MasterDetail and&amp;nbsp;ValueConverters. This one is available at &lt;A href="http://j832.com/work/namita/BasicDatabinding_MasterDetail.zip"&gt;Technology foundation demo&lt;/A&gt;&amp;nbsp;. Note that in addition to what i showed in my presentation, i have added Buttons to do MoveNext and MovePrevious on the page. Also i've added a MultiBinding and MultiValueConverter to bind the position of the Clock hand to show the relative amount of time left for the auction to end which required me to bind to both RemainingTime and StartTime. &lt;/P&gt;
&lt;P&gt;My 2nd demo showed flexible Template selection and the power of DataTemplates, where you can put anything ranging from 2D, 3D, Media etc. This demo is at &lt;A href="http://j832.com/work/namita/TemplateSelector_3DTemplate.zip"&gt;DataTemplatePower&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;In this demo I also showed a Grouped View of my data which easily grouped the same ListBox, to have 2 levels of grouping, each group having its own Style where one group is grouped simply by the property Category while the second group uses logic based on the Bid count to determine the grouping. Note how this particluar view is also Sorted in the CollectionView - all declaratively! You can access this at &lt;A href="http://j832.com/work/namita/GroupedView.zip"&gt;GroupedView&lt;/A&gt; .&lt;/P&gt;
&lt;P&gt;My 3rd demo showed flexible layout in the list controls and specifically used TreeMap Panel to layout the children of the ItemsControl. In addition it showed how easy it is to support&amp;nbsp;hierarchical data in WPF, by having an ItemsControl inside the DataTemplate for another ItemsControl. Also this particular sample is bound to ADO.NET DataTable. This demo is at &lt;A href="http://j832.com/work/namita/TreeMap_ADO.zip"&gt;TreeMap ADO demo&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;My 4rth demo showed databinding to xml into a TreeView using HiearchicalDataTemplates. This sample is at &lt;A href="http://j832.com/work/namita/TreeView_Xml.zip"&gt;TreeView Xml demo&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;njoy!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=472461" width="1" height="1"&gt;</content><author><name>Namitag</name><uri>http://blogs.msdn.com/members/Namitag.aspx</uri></author></entry><entry><title>Starting my Blog...</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/namitag/archive/2005/09/08/462721.aspx" /><id>http://blogs.msdn.com/namitag/archive/2005/09/08/462721.aspx</id><published>2005-09-09T04:58:00Z</published><updated>2005-09-09T04:58:00Z</updated><content type="html">&lt;P&gt;After working in Microsoft and Windows Presentation Foundation for 4 years,&amp;nbsp;I finally decided that I need to start blogging about how much I've learnt in the past 4 years and what an awesome platform we have built. &lt;/P&gt;
&lt;P&gt;I've worked on various technologies in the platform including Property engine, databinding, styling, templating, commanding and controls and cannot wait to ship this stuff and get feedback from the community on what we've built.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For those of you who are going to PDC, don't forget to attend &lt;A href="http://commnet.microsoftpdc.com/content/sessionview.aspx?TopicID=9e0a39c7-0f6d-42dc-aa68-e0c6cab6c3dd"&gt;my talk PRS324 &lt;/A&gt;- Using Data in Windows Presentation Foundation. I will be posting my slides and demos here, and also other bits and pieces of cool insights into the platform that can help you do some really cool stuff!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=462721" width="1" height="1"&gt;</content><author><name>Namitag</name><uri>http://blogs.msdn.com/members/Namitag.aspx</uri></author></entry></feed>