<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>batteryslave &#187; xaml</title>
	<atom:link href="http://www.batteryslave.com/tag/xaml/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.batteryslave.com</link>
	<description>minor thoughts about gadgets, code, podcasts and other technical stuff...</description>
	<lastBuildDate>Sat, 20 Feb 2010 18:41:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>itemtemplate selection by type in xaml only</title>
		<link>http://www.batteryslave.com/2009/09/itemtemplate-selection-by-type-in-xaml-only/</link>
		<comments>http://www.batteryslave.com/2009/09/itemtemplate-selection-by-type-in-xaml-only/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 17:29:23 +0000</pubDate>
		<dc:creator>batteryslave</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[wpf]]></category>
		<category><![CDATA[xaml]]></category>

		<guid isPermaLink="false">http://www.batteryslave.com/?p=136</guid>
		<description><![CDATA[some days ago i found my self in need to change the itemtemplate in a listbox according to their type. and if with less code as possible. i had done this in a treeview but i couldnt find the code again. so i needed to figure it out again and with some help from a [...]]]></description>
			<content:encoded><![CDATA[<p>some days ago i found my self in need to change the itemtemplate in a listbox according to their type. and if with less code as possible. i had done this in a treeview but i couldnt find the code again. so i needed to figure it out again and with some help from a collegue we ended with this:</p>
<pre class="brush: xml; ">

&lt;!-- more xaml here --&gt;

&lt;ItemsControl ItemsSource=&quot;{Binding Items}&quot;&gt;
  &lt;ItemsControl.Resources&gt;
    &lt;DataTemplate DataType=&quot;{x:Type MyNameSpace:MyType1}&quot;&gt;
      &lt;RadioButton /&gt;
    &lt;/DataTemplate&gt;
    &lt;DataTemplate DataType=&quot;{x:Type MyNameSpace:MyType2}&quot;&gt;
      &lt;ComboBox  /&gt;
    &lt;/DataTemplate&gt;
    &lt;DataTemplate DataType=&quot;{x:Type MyNameSpace:MyType3}&quot;&gt;
      &lt;TextBox /&gt;
    &lt;/DataTemplate&gt;
  &lt;/ItemsControl.Resources&gt;
&lt;/ItemsControl&gt;

&lt;!-- more xaml here --&gt;
</pre>
<p><strong>remark</strong>: you arent allowed to give a key to that resources. i suppose the type is kind of key here.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.batteryslave.com/2009/09/itemtemplate-selection-by-type-in-xaml-only/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
