<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How should I data bind a Polygon&#8217;s Points to a data source?</title>
	<atom:link href="http://bea.stollnitz.com/blog/?feed=rss2&#038;p=35" rel="self" type="application/rss+xml" />
	<link>http://bea.stollnitz.com/blog/?p=35</link>
	<description>on Silverlight and WPF</description>
	<lastBuildDate>Mon, 02 Aug 2010 17:57:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Brian</title>
		<link>http://bea.stollnitz.com/blog/?p=35&#038;cpage=1#comment-185272</link>
		<dc:creator>Brian</dc:creator>
		<pubDate>Fri, 22 Jan 2010 17:21:21 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=35#comment-185272</guid>
		<description>I  figured it out ...  XAML:

&lt;ItemsControl ItemsSource=&quot;{Binding ElementName=mapRoot, Path=Zones}&quot;&gt;
&lt;ItemsControl.ItemsPanel&gt;
&lt;ItemsPanelTemplate&gt;
&lt;Canvas Left=&quot;0&quot; Top=&quot;0&quot;/&gt;
&lt;/ItemsPanelTemplate&gt;
&lt;/ItemsControl.ItemsPanel&gt;
&lt;ItemsControl.ItemTemplate&gt;
&lt;DataTemplate&gt;
&lt;Polygon Canvas.ZIndex=&quot;1&quot; Points=&quot;{Binding ZonePointCollection}&quot;
Fill=&quot;{Binding ZoneFillColor}&quot; Opacity=&quot;0.02&quot;
Stroke=&quot;{Binding ZoneFillColor}&quot; /&gt;
&lt;/DataTemplate&gt;
&lt;/ItemsControl.ItemTemplate&gt;
&lt;/ItemsControl&gt;
                       
                            
                                
                                    
                                
                            
                            
                                
                                    
                                
                            
                        </description>
		<content:encoded><![CDATA[<p>I  figured it out &#8230;  XAML:</p>
<p>&lt;ItemsControl ItemsSource=&#8221;{Binding ElementName=mapRoot, Path=Zones}&#8221;&gt;<br />
&lt;ItemsControl.ItemsPanel&gt;<br />
&lt;ItemsPanelTemplate&gt;<br />
&lt;Canvas Left=&#8221;0&#8243; Top=&#8221;0&#8243;/&gt;<br />
&lt;/ItemsPanelTemplate&gt;<br />
&lt;/ItemsControl.ItemsPanel&gt;<br />
&lt;ItemsControl.ItemTemplate&gt;<br />
&lt;DataTemplate&gt;<br />
&lt;Polygon Canvas.ZIndex=&#8221;1&#8243; Points=&#8221;{Binding ZonePointCollection}&#8221;<br />
Fill=&#8221;{Binding ZoneFillColor}&#8221; Opacity=&#8221;0.02&#8243;<br />
Stroke=&#8221;{Binding ZoneFillColor}&#8221; /&gt;<br />
&lt;/DataTemplate&gt;<br />
&lt;/ItemsControl.ItemTemplate&gt;<br />
&lt;/ItemsControl&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian</title>
		<link>http://bea.stollnitz.com/blog/?p=35&#038;cpage=1#comment-185265</link>
		<dc:creator>Brian</dc:creator>
		<pubDate>Fri, 22 Jan 2010 16:34:02 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=35#comment-185265</guid>
		<description>I have a Collection of a Collection of points to display multiple Polygons on a Canvas with an ItemsControl.
The 2nd polygon is positioned vertically offset below the 1st polygon by the Y coordinates amount of the
lowest position in the 1st polygon.  I&#039;ve tried repositioning the Canvas.Top to 0, but it still doesn&#039;t reset it.
I know an ItemsControl displays things in a vertical stack, but how do you override the vertical stack behavior ?
                        
                        
                            
                                
                                    
                                
                            
                            
                                
                                    
                                
                            
                        
                    
                
            </description>
		<content:encoded><![CDATA[<p>I have a Collection of a Collection of points to display multiple Polygons on a Canvas with an ItemsControl.<br />
The 2nd polygon is positioned vertically offset below the 1st polygon by the Y coordinates amount of the<br />
lowest position in the 1st polygon.  I&#8217;ve tried repositioning the Canvas.Top to 0, but it still doesn&#8217;t reset it.<br />
I know an ItemsControl displays things in a vertical stack, but how do you override the vertical stack behavior ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bea</title>
		<link>http://bea.stollnitz.com/blog/?p=35&#038;cpage=1#comment-378</link>
		<dc:creator>Bea</dc:creator>
		<pubDate>Wed, 19 Sep 2007 06:51:15 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=35#comment-378</guid>
		<description>Hello,

That is a great question. I share the same opinion as Rob Relyea - I don&#039;t think you should be using DPs and DOs in your data source. If there is a possibility that you will be using those business objects with UI technologies other than WPF, you should strive for the best possible separation between UI and data, as it will save you a lot of time in the future. I have talked to several customers that ported their apps from WinForms to WPF, and the importance of keeping a clean separation of data and UI always comes up in our conversations.

If you feel that having elements specific to WPF would greatly simplify your UI layer, you may consider introducing an intermediate layer between your UI and your data. This layer collects all the information needed from the data source, and presents it to the UI layer in whatever form is most appropriate. You&#039;ve probably heard of the &lt;a href=&quot;http://blogs.msdn.com/johngossman/archive/2006/04/13/576163.aspx&quot; rel=&quot;nofollow&quot;&gt;Model-View-ViewModel pattern&lt;/a&gt; that John Gossman discusses on his blog. This is a very common technique that is used by the Blend team and other customers that are writing big WPF apps.

I hope this helps.

Bea</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>That is a great question. I share the same opinion as Rob Relyea &#8211; I don&#8217;t think you should be using DPs and DOs in your data source. If there is a possibility that you will be using those business objects with UI technologies other than WPF, you should strive for the best possible separation between UI and data, as it will save you a lot of time in the future. I have talked to several customers that ported their apps from WinForms to WPF, and the importance of keeping a clean separation of data and UI always comes up in our conversations.</p>
<p>If you feel that having elements specific to WPF would greatly simplify your UI layer, you may consider introducing an intermediate layer between your UI and your data. This layer collects all the information needed from the data source, and presents it to the UI layer in whatever form is most appropriate. You&#8217;ve probably heard of the <a href="http://blogs.msdn.com/johngossman/archive/2006/04/13/576163.aspx" rel="nofollow">Model-View-ViewModel pattern</a> that John Gossman discusses on his blog. This is a very common technique that is used by the Blend team and other customers that are writing big WPF apps.</p>
<p>I hope this helps.</p>
<p>Bea</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dr5274</title>
		<link>http://bea.stollnitz.com/blog/?p=35&#038;cpage=1#comment-81</link>
		<dc:creator>dr5274</dc:creator>
		<pubDate>Tue, 19 Jun 2007 18:45:25 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=35#comment-81</guid>
		<description>Hello Bea. My company is building some business objects that represent data and collections of data. Currently these objects all implement INotifyPropertyChanged, as well as a strongly typed event handler. The INotifyPropertyChanged seems to be keeping a WPF client happy, and the strongly typed event allow CLR clients to not go back to the object for data. There&#039;s questions amongst the developers as to whether or not we should implement thest as DependencyObjects with DependencyProperties. Some feel these aren&#039;t appropriate for business objects, and would unnecessarily tie the classes to WPF. Others think DP&#039;s would support WPF, and not impart too much class complexity. I found a comment from Rob Relyea that seemed to question the use of DP&#039;s for business objects, but we&#039;d like your opinion, too. Thanks!</description>
		<content:encoded><![CDATA[<p>Hello Bea. My company is building some business objects that represent data and collections of data. Currently these objects all implement INotifyPropertyChanged, as well as a strongly typed event handler. The INotifyPropertyChanged seems to be keeping a WPF client happy, and the strongly typed event allow CLR clients to not go back to the object for data. There&#8217;s questions amongst the developers as to whether or not we should implement thest as DependencyObjects with DependencyProperties. Some feel these aren&#8217;t appropriate for business objects, and would unnecessarily tie the classes to WPF. Others think DP&#8217;s would support WPF, and not impart too much class complexity. I found a comment from Rob Relyea that seemed to question the use of DP&#8217;s for business objects, but we&#8217;d like your opinion, too. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bea</title>
		<link>http://bea.stollnitz.com/blog/?p=35&#038;cpage=1#comment-80</link>
		<dc:creator>Bea</dc:creator>
		<pubDate>Fri, 06 Oct 2006 13:50:38 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=35#comment-80</guid>
		<description>Hi,
Thanks for letting me know. I fixed the problem, so it should be working now.
Thanks a lot!
Bea</description>
		<content:encoded><![CDATA[<p>Hi,<br />
Thanks for letting me know. I fixed the problem, so it should be working now.<br />
Thanks a lot!<br />
Bea</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://bea.stollnitz.com/blog/?p=35&#038;cpage=1#comment-79</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Fri, 06 Oct 2006 07:34:56 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=35#comment-79</guid>
		<description>Hi Beatriz. Looks like the link to your sample isn&#039;t working.</description>
		<content:encoded><![CDATA[<p>Hi Beatriz. Looks like the link to your sample isn&#8217;t working.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
