<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : Triggers for individual objects</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : XAML Snippets : Triggers for individual objects]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sun, 26 Apr 2026 01:01:07 +0000</pubDate>
  <lastBuildDate>Wed, 06 Jan 2010 11:03:40 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=15960</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[Triggers for individual objects : Sometimes just asking the question...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15960&amp;PID=56012&amp;title=triggers-for-individual-objects#56012</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2676">jpbro</a><br /><strong>Subject:</strong> 15960<br /><strong>Posted:</strong> 06 January 2010 at 11:03am<br /><br />Sometimes just asking the question inspires the answer - I was thinking of it backwards (that the x:Key property of the style would be the same as a key property of the object). Instead we can assign the {StaticResource KEY} to the Style property of the object. Something like:<br><br><table width="99%"><tr><td><pre class="BBcode"><br>&lt;Page&gt;<br>&lt;Page.Resources&gt;<br>&nbsp;&nbsp;&nbsp; &lt;Style x:Key='SwapImageIds' TargetType="Image"&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Setter Property="Source" Value="102"/&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Style.Triggers&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Trigger Property="IsMouseOver" Value="True"&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Trigger.Setters&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Setter Property="Source" Value="103"/&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/Trigger.Setters&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/Trigger&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/Style.Triggers&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/Style&gt;&nbsp;&nbsp;&nbsp; <br>&lt;/Page.Resources&gt;<br>&nbsp;&nbsp;&nbsp; <br>&lt;StackPanel&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Image Style='{StaticResource SwapImageIds}' /&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Image Source='file://c:/SOMEIMAGE' /&gt;<br>&lt;/StackPanel&gt;<br>&lt;/Page&gt;<br></pre></td></tr></table><br><br>Only the first image will be affected by the triggers.<br><br>Another important thing to note is that you shouldn't define any properties that you want to affect by triggers in the object, otherwise the trigger won't work.<br>]]>
   </description>
   <pubDate>Wed, 06 Jan 2010 11:03:40 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15960&amp;PID=56012&amp;title=triggers-for-individual-objects#56012</guid>
  </item> 
  <item>
   <title><![CDATA[Triggers for individual objects : I&amp;#039;ve looked over the documentation...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15960&amp;PID=56011&amp;title=triggers-for-individual-objects#56011</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2676">jpbro</a><br /><strong>Subject:</strong> 15960<br /><strong>Posted:</strong> 06 January 2010 at 10:26am<br /><br />I've looked over the documentation &amp; triggers.xaml sample, and I understand how to apply a trigger to all objects of a class (for example, all rectangles can become green on mouseover). What I would like to do is set a trigger for a particular object only, for example:<br><br>I have a StackPanel with 3 images. I would like to be able to change the Source property for only one of those images on mouse over (and restore the previous Source on mouse leave). I imagine I have to do something with the Key property, but nothing I have tried so far works.<br><br>Does anyone know how to do this? Thanks a lot in advance.<br>]]>
   </description>
   <pubDate>Wed, 06 Jan 2010 10:26:43 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15960&amp;PID=56011&amp;title=triggers-for-individual-objects#56011</guid>
  </item> 
 </channel>
</rss>