<?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 can I set multiple styles in WPF?</title>
	<atom:link href="http://bea.stollnitz.com/blog/?feed=rss2&#038;p=384" rel="self" type="application/rss+xml" />
	<link>http://bea.stollnitz.com/blog/?p=384</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: Bea</title>
		<link>http://bea.stollnitz.com/blog/?p=384&#038;cpage=1#comment-185129</link>
		<dc:creator>Bea</dc:creator>
		<pubDate>Thu, 21 Jan 2010 23:02:46 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=384#comment-185129</guid>
		<description>Hi Hans,

Thanks for sharing your solution. You&#039;re essentially using a behavior to do the same thing (&quot;behavior&quot; is just another name for encapsulating logic in an attached property). I&#039;ve always been a big fan of behaviors. Your solution is very creative.

I&#039;m sure there are many solutions to this problem, and I like seeing solutions that are different from mine. So thanks for your comment!

Bea</description>
		<content:encoded><![CDATA[<p>Hi Hans,</p>
<p>Thanks for sharing your solution. You&#8217;re essentially using a behavior to do the same thing (&#8220;behavior&#8221; is just another name for encapsulating logic in an attached property). I&#8217;ve always been a big fan of behaviors. Your solution is very creative.</p>
<p>I&#8217;m sure there are many solutions to this problem, and I like seeing solutions that are different from mine. So thanks for your comment!</p>
<p>Bea</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hans</title>
		<link>http://bea.stollnitz.com/blog/?p=384&#038;cpage=1#comment-176044</link>
		<dc:creator>Hans</dc:creator>
		<pubDate>Sat, 12 Dec 2009 20:05:20 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=384#comment-176044</guid>
		<description>Hi,

great blog, and cool post. I should have read this when it was written. Unfortunately, I didn&#039;t, so I came up with the alternative solution I describe here: http://wpfglue.wordpress.com/2009/11/30/css-class-equivalent-in-wpf/

I like your solution because it is more powerful than mine, but I like mine also because it is less invasive, and has the potential of creating classes that are independent of the XAML element&#039;s type.

Anyway, thanks for shareing this,
Hans</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>great blog, and cool post. I should have read this when it was written. Unfortunately, I didn&#8217;t, so I came up with the alternative solution I describe here: <a href="http://wpfglue.wordpress.com/2009/11/30/css-class-equivalent-in-wpf/" rel="nofollow">http://wpfglue.wordpress.com/2009/11/30/css-class-equivalent-in-wpf/</a></p>
<p>I like your solution because it is more powerful than mine, but I like mine also because it is less invasive, and has the potential of creating classes that are independent of the XAML element&#8217;s type.</p>
<p>Anyway, thanks for shareing this,<br />
Hans</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bea</title>
		<link>http://bea.stollnitz.com/blog/?p=384&#038;cpage=1#comment-169874</link>
		<dc:creator>Bea</dc:creator>
		<pubDate>Tue, 17 Nov 2009 21:44:54 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=384#comment-169874</guid>
		<description>Hi Berryl,

Yeah, I noticed that too. I also get the following incorrect error:
Error	1	No constructor for type &#039;MultiStyleExtension&#039; has 1 parameters.	

VS 2008 has trouble dealing with this markup extension, unfortunately.
I just upgraded this sample to VS 2010, and the designer is capable of handling the scenario just fine. That&#039;s great news :)

Thanks,
Bea</description>
		<content:encoded><![CDATA[<p>Hi Berryl,</p>
<p>Yeah, I noticed that too. I also get the following incorrect error:<br />
Error	1	No constructor for type &#8216;MultiStyleExtension&#8217; has 1 parameters.	</p>
<p>VS 2008 has trouble dealing with this markup extension, unfortunately.<br />
I just upgraded this sample to VS 2010, and the designer is capable of handling the scenario just fine. That&#8217;s great news :)</p>
<p>Thanks,<br />
Bea</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Berryl</title>
		<link>http://bea.stollnitz.com/blog/?p=384&#038;cpage=1#comment-169579</link>
		<dc:creator>Berryl</dc:creator>
		<pubDate>Sat, 14 Nov 2009 17:31:42 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=384#comment-169579</guid>
		<description>Hi Bea. The test program runs perfectly but the xaml designer will not load, saying there is an error at the first use of the extension (&quot;Error	1	The StaticResource extension can only be used in the context of loading XAML...). Is this to be expected? As an aside is the designer in VS 2010 any less brittle when it comes to &#039;errors&#039; like this? Thanks</description>
		<content:encoded><![CDATA[<p>Hi Bea. The test program runs perfectly but the xaml designer will not load, saying there is an error at the first use of the extension (&#8220;Error	1	The StaticResource extension can only be used in the context of loading XAML&#8230;). Is this to be expected? As an aside is the designer in VS 2010 any less brittle when it comes to &#8216;errors&#8217; like this? Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bea</title>
		<link>http://bea.stollnitz.com/blog/?p=384&#038;cpage=1#comment-167215</link>
		<dc:creator>Bea</dc:creator>
		<pubDate>Wed, 21 Oct 2009 16:23:47 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=384#comment-167215</guid>
		<description>Thanks for posting Daniel! That&#039;s a cool idea.

Wordpress doesn&#039;t support unescaped &lt; in comments, which is why your sample XAML didn&#039;t show up. I&#039;m assuming the syntax you typed is the following:

&lt;Button Style=&quot;{local:MultiStyle . BigBoldButtonStyle}&quot; /&gt;

Bea</description>
		<content:encoded><![CDATA[<p>Thanks for posting Daniel! That&#8217;s a cool idea.</p>
<p>Wordpress doesn&#8217;t support unescaped &lt; in comments, which is why your sample XAML didn&#8217;t show up. I&#8217;m assuming the syntax you typed is the following:</p>
<p>&lt;Button Style=&#8221;{local:MultiStyle . BigBoldButtonStyle}&#8221; /&gt;</p>
<p>Bea</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Richardson</title>
		<link>http://bea.stollnitz.com/blog/?p=384&#038;cpage=1#comment-167188</link>
		<dc:creator>Daniel Richardson</dc:creator>
		<pubDate>Wed, 21 Oct 2009 07:54:43 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=384#comment-167188</guid>
		<description>As I am using this in a templated scenario I also had to make some further adjustments...
Additional info can be found here http://tomlev2.wordpress.com/2009/08/23/wpf-markup-extensions-and-templates/</description>
		<content:encoded><![CDATA[<p>As I am using this in a templated scenario I also had to make some further adjustments&#8230;<br />
Additional info can be found here <a href="http://tomlev2.wordpress.com/2009/08/23/wpf-markup-extensions-and-templates/" rel="nofollow">http://tomlev2.wordpress.com/2009/08/23/wpf-markup-extensions-and-templates/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Richardson</title>
		<link>http://bea.stollnitz.com/blog/?p=384&#038;cpage=1#comment-167186</link>
		<dc:creator>Daniel Richardson</dc:creator>
		<pubDate>Wed, 21 Oct 2009 06:59:56 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=384#comment-167186</guid>
		<description>Hi ya, your blog is the place to go for any WPF inspiration
Due to the theming in my application I need to be able to combine styles with the default style.

I updated the code in the ProvideValue method as follows...           

			object key = null;

            foreach (string currentResourceKey in resourceKeys)
            {
                key = currentResourceKey;
                if (currentResourceKey == &quot;.&quot;)
                {
                    IProvideValueTarget service = (IProvideValueTarget)serviceProvider.GetService(typeof(IProvideValueTarget));
                    key = service.TargetObject.GetType();
                }
                Style currentStyle = new StaticResourceExtension(key).ProvideValue(serviceProvider) as Style;

allowing for the following syntax


(assuming the implicit style and BigBoldButtonStyle are specified)</description>
		<content:encoded><![CDATA[<p>Hi ya, your blog is the place to go for any WPF inspiration<br />
Due to the theming in my application I need to be able to combine styles with the default style.</p>
<p>I updated the code in the ProvideValue method as follows&#8230;           </p>
<p>			object key = null;</p>
<p>            foreach (string currentResourceKey in resourceKeys)<br />
            {<br />
                key = currentResourceKey;<br />
                if (currentResourceKey == &#8220;.&#8221;)<br />
                {<br />
                    IProvideValueTarget service = (IProvideValueTarget)serviceProvider.GetService(typeof(IProvideValueTarget));<br />
                    key = service.TargetObject.GetType();<br />
                }<br />
                Style currentStyle = new StaticResourceExtension(key).ProvideValue(serviceProvider) as Style;</p>
<p>allowing for the following syntax</p>
<p>(assuming the implicit style and BigBoldButtonStyle are specified)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://bea.stollnitz.com/blog/?p=384&#038;cpage=1#comment-167163</link>
		<dc:creator>David</dc:creator>
		<pubDate>Tue, 20 Oct 2009 22:10:08 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=384#comment-167163</guid>
		<description>This is exactly what I&#039;ve been looking for. And the space-delimiting is fine because this makes it just like using multiple CSS classes, which is a feature I always liked. Thank you!</description>
		<content:encoded><![CDATA[<p>This is exactly what I&#8217;ve been looking for. And the space-delimiting is fine because this makes it just like using multiple CSS classes, which is a feature I always liked. Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas</title>
		<link>http://bea.stollnitz.com/blog/?p=384&#038;cpage=1#comment-167095</link>
		<dc:creator>Thomas</dc:creator>
		<pubDate>Tue, 20 Oct 2009 08:20:09 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=384#comment-167095</guid>
		<description>great solution bea!
wanna hear more from you! ;)</description>
		<content:encoded><![CDATA[<p>great solution bea!<br />
wanna hear more from you! ;)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
