<?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? &#8211; Part II</title>
	<atom:link href="http://bea.stollnitz.com/blog/?feed=rss2&#038;p=36" rel="self" type="application/rss+xml" />
	<link>http://bea.stollnitz.com/blog/?p=36</link>
	<description>on Silverlight and WPF</description>
	<lastBuildDate>Thu, 22 Jul 2010 20:56:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Bea</title>
		<link>http://bea.stollnitz.com/blog/?p=36&#038;cpage=1#comment-388</link>
		<dc:creator>Bea</dc:creator>
		<pubDate>Thu, 20 Sep 2007 06:47:17 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=36#comment-388</guid>
		<description>Hi Vishal,

I showed in &lt;a href=&quot;http://www.beacosta.com/blog/?p=41&quot; rel=&quot;nofollow&quot;&gt;this blog post&lt;/a&gt; how you can get a handle to an element within a DataTemplate. You need to call the FindName method on the instance of the DataTemplate, and pass the name of the element you&#039;re interested in, and an instance of the object the template is being applied to (in your case, the UserControl).

Thanks,
Bea</description>
		<content:encoded><![CDATA[<p>Hi Vishal,</p>
<p>I showed in <a href="http://www.beacosta.com/blog/?p=41" rel="nofollow">this blog post</a> how you can get a handle to an element within a DataTemplate. You need to call the FindName method on the instance of the DataTemplate, and pass the name of the element you&#8217;re interested in, and an instance of the object the template is being applied to (in your case, the UserControl).</p>
<p>Thanks,<br />
Bea</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vishal G Pillai</title>
		<link>http://bea.stollnitz.com/blog/?p=36&#038;cpage=1#comment-78</link>
		<dc:creator>Vishal G Pillai</dc:creator>
		<pubDate>Thu, 06 Sep 2007 17:48:33 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=36#comment-78</guid>
		<description>Hi Beatriz,

I have a doubt about getting an element from a DataTemplate. I will explain the scenario.

I have created a user control ( let say it as X )which exposes property which of of type DataTemplate. Another user control( let say it as Y ) uses X. to create another usable user control Z. But while we are applying template to X from Y, I need some element in the DataTemplate to do some custom operation. But I am not able to get that. I am providing the code here to check.

Here is the template 
??DataTemplate x:Key=&quot;dingTemplate&quot;??
??StackPanel Orientation=&quot;Horizontal&quot; Margin=&quot;2&quot; Name=&quot;stak&quot; ??
??Grid Width=&quot;{Binding RelativeSource={RelativeSource AncestorType={x:Type StackPanel}}, Path=ActualWidth}&quot;??
??Grid.ColumnDefinitions??
??ColumnDefinition Width=&quot;Auto&quot;/??
??ColumnDefinition Width=&quot;*&quot;/??
??ColumnDefinition Width=&quot;Auto&quot;/??
??/Grid.ColumnDefinitions??
??TextBlock Text=&quot;xxxx :&quot; Grid.Column=&quot;0&quot; Padding=&quot;4,2,4,2&quot; VerticalAlignment=&quot;Center&quot;/??
??TextBox Name=&quot;yyy&quot; Grid.Column=&quot;1&quot; Margin=&quot;4,0,4,0&quot; /??
??Button Name=&quot;buttonTemp&quot; Content=&quot;ZZZ&quot; Grid.Column=&quot;2&quot; Padding=&quot;12,2,12,2&quot;/??
??/Grid??
??/StackPanel??
??/DataTemplate??

And it is applied to another user control like 

??DingDongControl x:Name=&quot;dingdongCtrl&quot; CustomHeaderTemplate=&quot;{StaticResource dingTemplate}&quot; ??

I need the element Button ( &quot;buttonTemp&quot;) from that template. How I can get that


Vishal</description>
		<content:encoded><![CDATA[<p>Hi Beatriz,</p>
<p>I have a doubt about getting an element from a DataTemplate. I will explain the scenario.</p>
<p>I have created a user control ( let say it as X )which exposes property which of of type DataTemplate. Another user control( let say it as Y ) uses X. to create another usable user control Z. But while we are applying template to X from Y, I need some element in the DataTemplate to do some custom operation. But I am not able to get that. I am providing the code here to check.</p>
<p>Here is the template<br />
??DataTemplate x:Key=&#8221;dingTemplate&#8221;??<br />
??StackPanel Orientation=&#8221;Horizontal&#8221; Margin=&#8221;2&#8243; Name=&#8221;stak&#8221; ??<br />
??Grid Width=&#8221;{Binding RelativeSource={RelativeSource AncestorType={x:Type StackPanel}}, Path=ActualWidth}&#8221;??<br />
??Grid.ColumnDefinitions??<br />
??ColumnDefinition Width=&#8221;Auto&#8221;/??<br />
??ColumnDefinition Width=&#8221;*&#8221;/??<br />
??ColumnDefinition Width=&#8221;Auto&#8221;/??<br />
??/Grid.ColumnDefinitions??<br />
??TextBlock Text=&#8221;xxxx :&#8221; Grid.Column=&#8221;0&#8243; Padding=&#8221;4,2,4,2&#8243; VerticalAlignment=&#8221;Center&#8221;/??<br />
??TextBox Name=&#8221;yyy&#8221; Grid.Column=&#8221;1&#8243; Margin=&#8221;4,0,4,0&#8243; /??<br />
??Button Name=&#8221;buttonTemp&#8221; Content=&#8221;ZZZ&#8221; Grid.Column=&#8221;2&#8243; Padding=&#8221;12,2,12,2&#8243;/??<br />
??/Grid??<br />
??/StackPanel??<br />
??/DataTemplate??</p>
<p>And it is applied to another user control like </p>
<p>??DingDongControl x:Name=&#8221;dingdongCtrl&#8221; CustomHeaderTemplate=&#8221;{StaticResource dingTemplate}&#8221; ??</p>
<p>I need the element Button ( &#8220;buttonTemp&#8221;) from that template. How I can get that</p>
<p>Vishal</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bea</title>
		<link>http://bea.stollnitz.com/blog/?p=36&#038;cpage=1#comment-77</link>
		<dc:creator>Bea</dc:creator>
		<pubDate>Sat, 21 Oct 2006 23:02:43 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=36#comment-77</guid>
		<description>Hi,

I have a few questions about what you&#039;re trying to do. What do you mean by &quot;propagate the SelectedValue back to the Address&quot;? What exactly do you want to happen when you select a value? What does your data structure look like, is it a Dictionary of [CountryName, Country] and an instance of Address that holds the SelectedValue?

I should be able to help you once I understand exactly what your app looks like.

Thanks,
Bea</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I have a few questions about what you&#8217;re trying to do. What do you mean by &#8220;propagate the SelectedValue back to the Address&#8221;? What exactly do you want to happen when you select a value? What does your data structure look like, is it a Dictionary of [CountryName, Country] and an instance of Address that holds the SelectedValue?</p>
<p>I should be able to help you once I understand exactly what your app looks like.</p>
<p>Thanks,<br />
Bea</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: captain ramen</title>
		<link>http://bea.stollnitz.com/blog/?p=36&#038;cpage=1#comment-76</link>
		<dc:creator>captain ramen</dc:creator>
		<pubDate>Fri, 20 Oct 2006 20:21:24 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=36#comment-76</guid>
		<description>I have a question about binding ItemsControls. Let&#039;s say I had

public class Address
{
public string CountryName
{ get; set; }
public string Country
{ get; set; }
}

Binding the two properties to a TextBox is easy enough, but what about a ComboBox, where the ComboBox is bound to a list of possible values (in this case a Dictionary`1[String, String]). I&#039;ve looked everywhere but I can&#039;t figure out how to propogate the SelectedValue back to the Address without going into codebehind. Is it even possible to do this declaratively?</description>
		<content:encoded><![CDATA[<p>I have a question about binding ItemsControls. Let&#8217;s say I had</p>
<p>public class Address<br />
{<br />
public string CountryName<br />
{ get; set; }<br />
public string Country<br />
{ get; set; }<br />
}</p>
<p>Binding the two properties to a TextBox is easy enough, but what about a ComboBox, where the ComboBox is bound to a list of possible values (in this case a Dictionary`1[String, String]). I&#8217;ve looked everywhere but I can&#8217;t figure out how to propogate the SelectedValue back to the Address without going into codebehind. Is it even possible to do this declaratively?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bea</title>
		<link>http://bea.stollnitz.com/blog/?p=36&#038;cpage=1#comment-75</link>
		<dc:creator>Bea</dc:creator>
		<pubDate>Thu, 19 Oct 2006 13:51:38 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=36#comment-75</guid>
		<description>Hi Sheva,

Ah, I haven&#039;t tried pre-compiling the MarkupExtension but I believe you, and thanks for the tip.

I opened the bug about the Invalidate calls, but that hasn&#039;t been looked at, so I don&#039;t know the technical reasons why it&#039;s behaving this way. I am hoping it&#039;s a simple bug that we can fix for next version. I agree with you we shouldn&#039;t have to call those manually.

Thanks for your comments.
Bea</description>
		<content:encoded><![CDATA[<p>Hi Sheva,</p>
<p>Ah, I haven&#8217;t tried pre-compiling the MarkupExtension but I believe you, and thanks for the tip.</p>
<p>I opened the bug about the Invalidate calls, but that hasn&#8217;t been looked at, so I don&#8217;t know the technical reasons why it&#8217;s behaving this way. I am hoping it&#8217;s a simple bug that we can fix for next version. I agree with you we shouldn&#8217;t have to call those manually.</p>
<p>Thanks for your comments.<br />
Bea</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sheva</title>
		<link>http://bea.stollnitz.com/blog/?p=36&#038;cpage=1#comment-74</link>
		<dc:creator>Sheva</dc:creator>
		<pubDate>Wed, 18 Oct 2006 11:16:36 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=36#comment-74</guid>
		<description>Hi, Bea, nice article, actually you can use property-attribute syntax to specifiy the markup extension as long as your custom markup extension is pre-compiled, which means that your custom markup extension should be put into another assembly. and another thing which I cannot understand is that the PointCollectionProperty has FrameworkPropertyMetaDataOptions.AffectsRender and FrameworkPropertyMetaDataOptions.AffectsMeasure marked, then why should we manually call the InvalidateMeasure and InvalidateVisual explicitly.

Sheva</description>
		<content:encoded><![CDATA[<p>Hi, Bea, nice article, actually you can use property-attribute syntax to specifiy the markup extension as long as your custom markup extension is pre-compiled, which means that your custom markup extension should be put into another assembly. and another thing which I cannot understand is that the PointCollectionProperty has FrameworkPropertyMetaDataOptions.AffectsRender and FrameworkPropertyMetaDataOptions.AffectsMeasure marked, then why should we manually call the InvalidateMeasure and InvalidateVisual explicitly.</p>
<p>Sheva</p>
]]></content:encoded>
	</item>
</channel>
</rss>
