<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Alejandro Bonilla&#039;s Blog</title>
	<atom:link href="http://alejandrobog.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://alejandrobog.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Wed, 20 Jul 2011 13:43:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='alejandrobog.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Alejandro Bonilla&#039;s Blog</title>
		<link>http://alejandrobog.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://alejandrobog.wordpress.com/osd.xml" title="Alejandro Bonilla&#039;s Blog" />
	<atom:link rel='hub' href='http://alejandrobog.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Unknown build error, &#8216;Item has already been added. Key in dictionary: &#8216;xxx&#8217;  Key being added: &#8216;xxx&#8221;</title>
		<link>http://alejandrobog.wordpress.com/2009/11/24/unknown-build-error-item-has-already-been-added-key-in-dictionary-xxx-key-being-added-xxx/</link>
		<comments>http://alejandrobog.wordpress.com/2009/11/24/unknown-build-error-item-has-already-been-added-key-in-dictionary-xxx-key-being-added-xxx/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 01:35:03 +0000</pubDate>
		<dc:creator>alejandrobog</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://alejandrobog.wordpress.com/?p=34</guid>
		<description><![CDATA[I got this message today, it was interesting that it only happened the first time I try to build after a change in the code, and every time when I hit build for the second time it worked. The problem was that somehow the visual studio project file have duplicate items, in my case it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alejandrobog.wordpress.com&amp;blog=8405727&amp;post=34&amp;subd=alejandrobog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I got this message today, it was interesting that it only happened the first time I try to build after a change in the code, and every time when I hit build for the second time it worked. The problem was that somehow the visual studio project file have duplicate items, in my case it was an image. So just edit the project file and get rid of the duplicate item, that’s it.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alejandrobog.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alejandrobog.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alejandrobog.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alejandrobog.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/alejandrobog.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/alejandrobog.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/alejandrobog.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/alejandrobog.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alejandrobog.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alejandrobog.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alejandrobog.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alejandrobog.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alejandrobog.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alejandrobog.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alejandrobog.wordpress.com&amp;blog=8405727&amp;post=34&amp;subd=alejandrobog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://alejandrobog.wordpress.com/2009/11/24/unknown-build-error-item-has-already-been-added-key-in-dictionary-xxx-key-being-added-xxx/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0e1a71fcbf5d673f01bb1469b25a8e3e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alejandrobog</media:title>
		</media:content>
	</item>
		<item>
		<title>Pass your own arguments to the ClientValidationFunction in a CustomValidator</title>
		<link>http://alejandrobog.wordpress.com/2009/09/27/pass-your-own-arguments-to-the-clientvalidationfunction-in-a-customvalidator/</link>
		<comments>http://alejandrobog.wordpress.com/2009/09/27/pass-your-own-arguments-to-the-clientvalidationfunction-in-a-customvalidator/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 05:45:16 +0000</pubDate>
		<dc:creator>alejandrobog</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Add parameters ClientValidationFunction]]></category>
		<category><![CDATA[ClientValidationFunction arguments]]></category>
		<category><![CDATA[ClientValidationFunction parameters]]></category>
		<category><![CDATA[CustomValidator ClientValidationFunction]]></category>

		<guid isPermaLink="false">http://alejandrobog.wordpress.com/?p=30</guid>
		<description><![CDATA[Pass your own parameters to the ClientValidationFunction in a CustomValidator

When using a CustomValidator in asp.net you can specify a ClientValidationFunction to run on your client side. This function need to have 2 parameters (sender, args). The sender is the customvalidator control and the args is where you can specify the result of your validation(args.IsValid) and also access to the value of the control attached to you custom validator(args.Value). This is very useful for more complex validation on client side.

But what if you need to pass additional arguments. For example if you want to use the same client function. Here is an option, you can add properties to you validation object, and then access them from the source parameter in your client function. Take a look at the example:
<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alejandrobog.wordpress.com&amp;blog=8405727&amp;post=30&amp;subd=alejandrobog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When using a CustomValidator in asp.net you can specify a ClientValidationFunction to run on your client side. This function need to have 2 parameters (sender, args). The sender is the customvalidator control and the args is where you can specify the result of your validation(args.IsValid) and also access to the value of the control attached to you custom validator(args.Value). This is very useful for more complex validation on client side.</p>
<p>But what if you need to pass additional arguments. For example if you want to use the same client function for more than one control. Here is an option, you can add properties to your validation object, and then access them from the source parameter in your client function. Take a look at the example:</p>
<p>&lt;head runat=&#8221;server&#8221;&gt;<br />
&lt;title&gt;&lt;/title&gt;<br />
&lt;script language=&#8221;JavaScript&#8221;&gt;<br />
function validateRadioButtons(sender, args) {<br />
var radioButton1 = document.getElementById(sender.RB1);<br />
var radioButton2 = document.getElementById(sender.RB2);<br />
args.IsValid = radioButton1.checked != radioButton2.checked;<br />
}<br />
&lt;/script&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body&gt;<br />
&lt;form id=&#8221;form1&#8243; runat=&#8221;server&#8221;&gt;<br />
&lt;div&gt;<br />
Question 1:<br />
&lt;asp:RadioButton ID=&#8221;RadioButton1&#8243; runat=&#8221;server&#8221; Text=&#8221;Yes&#8221; /&gt;<br />
&lt;asp:RadioButton ID=&#8221;RadioButton2&#8243; runat=&#8221;server&#8221; Text=&#8221;No&#8221; /&gt;<br />
&lt;asp:CustomValidator ID=&#8221;CustomValidator1&#8243; ClientValidationFunction=&#8221;validateRadioButtons&#8221;<br />
runat=&#8221;server&#8221; ErrorMessage=&#8221;CustomValidator&#8221;&gt;&lt;/asp:CustomValidator&gt;<br />
&lt;br /&gt;<br />
Question 2:<br />
&lt;asp:RadioButton ID=&#8221;RadioButton3&#8243; runat=&#8221;server&#8221; Text=&#8221;Yes&#8221; /&gt;<br />
&lt;asp:RadioButton ID=&#8221;RadioButton4&#8243; runat=&#8221;server&#8221; Text=&#8221;No&#8221; /&gt;<br />
&lt;asp:CustomValidator ID=&#8221;CustomValidator2&#8243; ClientValidationFunction=&#8221;validateRadioButtons&#8221;<br />
runat=&#8221;server&#8221; ErrorMessage=&#8221;CustomValidator&#8221;&gt;&lt;/asp:CustomValidator&gt;<br />
&lt;br /&gt;<br />
Question 3:<br />
&lt;asp:RadioButton ID=&#8221;RadioButton5&#8243; runat=&#8221;server&#8221; Text=&#8221;Yes&#8221; /&gt;<br />
&lt;asp:RadioButton ID=&#8221;RadioButton6&#8243; runat=&#8221;server&#8221; Text=&#8221;No&#8221; /&gt;<br />
&lt;asp:CustomValidator ID=&#8221;CustomValidator4&#8243; ClientValidationFunction=&#8221;validateRadioButtons&#8221;<br />
runat=&#8221;server&#8221; ErrorMessage=&#8221;CustomValidator&#8221;&gt;&lt;/asp:CustomValidator&gt;<br />
&lt;br /&gt;<br />
&lt;/div&gt;<br />
&lt;/form&gt;<br />
&lt;/body&gt;</p>
<p>protected void Page_Load(object sender, EventArgs e)<br />
{<br />
Page.ClientScript.RegisterExpandoAttribute(CustomValidator1.ClientID, &#8220;RB1&#8243;, RadioButton1.ClientID, false);<br />
Page.ClientScript.RegisterExpandoAttribute(CustomValidator1.ClientID, &#8220;RB2&#8243;, RadioButton2.ClientID, false);</p>
<p>Page.ClientScript.RegisterExpandoAttribute(CustomValidator2.ClientID, &#8220;RB1&#8243;, RadioButton3.ClientID, false);<br />
Page.ClientScript.RegisterExpandoAttribute(CustomValidator2.ClientID, &#8220;RB2&#8243;, RadioButton4.ClientID, false);</p>
<p>Page.ClientScript.RegisterExpandoAttribute(CustomValidator3.ClientID, &#8220;RB1&#8243;, RadioButton5.ClientID, false);<br />
Page.ClientScript.RegisterExpandoAttribute(CustomValidator3.ClientID, &#8220;RB2&#8243;, RadioButton6.ClientID, false);<br />
}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alejandrobog.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alejandrobog.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alejandrobog.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alejandrobog.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/alejandrobog.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/alejandrobog.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/alejandrobog.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/alejandrobog.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alejandrobog.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alejandrobog.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alejandrobog.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alejandrobog.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alejandrobog.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alejandrobog.wordpress.com/30/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alejandrobog.wordpress.com&amp;blog=8405727&amp;post=30&amp;subd=alejandrobog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://alejandrobog.wordpress.com/2009/09/27/pass-your-own-arguments-to-the-clientvalidationfunction-in-a-customvalidator/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0e1a71fcbf5d673f01bb1469b25a8e3e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alejandrobog</media:title>
		</media:content>
	</item>
		<item>
		<title>LINQ to SQL — Can’t modify return type of stored procedure</title>
		<link>http://alejandrobog.wordpress.com/2009/09/23/linq-to-sql-%e2%80%94-can%e2%80%99t-modify-return-type-of-stored-procedure/</link>
		<comments>http://alejandrobog.wordpress.com/2009/09/23/linq-to-sql-%e2%80%94-can%e2%80%99t-modify-return-type-of-stored-procedure/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 05:15:56 +0000</pubDate>
		<dc:creator>alejandrobog</dc:creator>
				<category><![CDATA[Linq to sql]]></category>
		<category><![CDATA[linq to sql store procedure]]></category>
		<category><![CDATA[modify return type of stored procedure]]></category>
		<category><![CDATA[user defined data type]]></category>

		<guid isPermaLink="false">http://alejandrobog.wordpress.com/?p=26</guid>
		<description><![CDATA[I&#8217;ve used store procedures in my data model several times without a problem until, I got this message. What I found out is that when you try to add  a store procedure with a user defined data type you have this issue just change it to a non user defined data type and you would be able to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alejandrobog.wordpress.com&amp;blog=8405727&amp;post=26&amp;subd=alejandrobog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve used store procedures in my data model several times without a problem until, I got this message. What I found out is that when you try to add  a store procedure with a user defined data type you have this issue just change it to a non user defined data type and you would be able to specify a return type.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alejandrobog.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alejandrobog.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alejandrobog.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alejandrobog.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/alejandrobog.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/alejandrobog.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/alejandrobog.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/alejandrobog.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alejandrobog.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alejandrobog.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alejandrobog.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alejandrobog.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alejandrobog.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alejandrobog.wordpress.com/26/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alejandrobog.wordpress.com&amp;blog=8405727&amp;post=26&amp;subd=alejandrobog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://alejandrobog.wordpress.com/2009/09/23/linq-to-sql-%e2%80%94-can%e2%80%99t-modify-return-type-of-stored-procedure/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0e1a71fcbf5d673f01bb1469b25a8e3e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alejandrobog</media:title>
		</media:content>
	</item>
		<item>
		<title>The custom tool msdiscocodegenerator failed &#8211;  linq to sql data model</title>
		<link>http://alejandrobog.wordpress.com/2009/09/23/the-custom-tool-msdiscocodegenerator-failed-linq-to-sql-data-model/</link>
		<comments>http://alejandrobog.wordpress.com/2009/09/23/the-custom-tool-msdiscocodegenerator-failed-linq-to-sql-data-model/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 04:50:50 +0000</pubDate>
		<dc:creator>alejandrobog</dc:creator>
				<category><![CDATA[Linq to sql]]></category>
		<category><![CDATA[custom tool failed]]></category>
		<category><![CDATA[msdiscocodegenerator]]></category>

		<guid isPermaLink="false">http://alejandrobog.wordpress.com/?p=23</guid>
		<description><![CDATA[Weird thing, when using a linq to sql data model with a partial class you may get the message "The custom tool msdiscocodegenerator failed"  when using the custom tool. You may also loose your model auto-generated code when changing the data model. I dont know why but this happens if you have using statements before the name space definition. Check it out<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alejandrobog.wordpress.com&amp;blog=8405727&amp;post=23&amp;subd=alejandrobog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Weird thing, when using a linq to sql data model with a partial class you may get the message &#8220;The custom tool msdiscocodegenerator failed&#8221;  when using the custom tool. You may also loose your model auto-generated code when changing the data model. I dont know why but this happens if you have using statements before the name space definition. Check it out</p>
<div><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">namespace </span></span><span style="font-size:x-small;">Backend.Entities &#8211; This works<br />
{<br />
</span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">    using</span></span><span style="font-size:x-small;"> System;<br />
    </span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">using</span></span><span style="font-size:x-small;"> System.Collections.Generic;</span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"> </span></span></div>
<div><span style="font-size:x-small;"> </span></div>
<div><span style="font-size:x-small;">    <span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">public</span></span><span style="font-size:x-small;"> </span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">partial</span></span><span style="font-size:x-small;"> </span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">class</span></span><span style="font-size:x-small;"> </span><span style="color:#2b91af;font-size:x-small;"><span style="color:#2b91af;font-size:x-small;">EntitiesDataContext { &#8230;..</span></span><span style="font-size:x-small;"> </span></span></div>
<div><span style="color:#0000ff;font-size:x-small;"><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
using</span><span style="font-size:x-small;"> System;<br />
</span><span style="color:#0000ff;font-size:x-small;">using </span><span style="font-size:x-small;">System.Collections.Generic;<br />
</span>namespace <span style="font-size:x-small;">Backend.Entities &#8211; This does&#8217;nt<br />
{</span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><br />
   </span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">public</span></span><span style="font-size:x-small;"> </span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">partial</span></span><span style="font-size:x-small;"> </span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">class</span></span><span style="font-size:x-small;"> </span><span style="color:#2b91af;font-size:x-small;"><span style="color:#2b91af;font-size:x-small;">EntitiesDataContext { &#8230;..</span></span><span style="font-size:x-small;"> </span></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alejandrobog.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alejandrobog.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alejandrobog.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alejandrobog.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/alejandrobog.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/alejandrobog.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/alejandrobog.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/alejandrobog.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alejandrobog.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alejandrobog.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alejandrobog.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alejandrobog.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alejandrobog.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alejandrobog.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alejandrobog.wordpress.com&amp;blog=8405727&amp;post=23&amp;subd=alejandrobog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://alejandrobog.wordpress.com/2009/09/23/the-custom-tool-msdiscocodegenerator-failed-linq-to-sql-data-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0e1a71fcbf5d673f01bb1469b25a8e3e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alejandrobog</media:title>
		</media:content>
	</item>
		<item>
		<title>Silverlight datagrid change foreground color on VisualStateManager(mouseover, selected)</title>
		<link>http://alejandrobog.wordpress.com/2009/07/02/silverlight-datagrid-change-foreground-color-on-visualstatemanagermouseover-selected/</link>
		<comments>http://alejandrobog.wordpress.com/2009/07/02/silverlight-datagrid-change-foreground-color-on-visualstatemanagermouseover-selected/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 02:43:27 +0000</pubDate>
		<dc:creator>alejandrobog</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[DataGridCellPresenter]]></category>
		<category><![CDATA[foreground datagrid]]></category>
		<category><![CDATA[mouse over]]></category>
		<category><![CDATA[mouseover]]></category>
		<category><![CDATA[VisualStateManager]]></category>

		<guid isPermaLink="false">http://alejandrobog.wordpress.com/?p=3</guid>
		<description><![CDATA[Here is how you could change font properties using the VisualStateManager in a Silverlight datagrid. The main problem is that when trying to edit a copy of the grid style the row content is presented as a DataGridCellPresenter, which doesn&#8217;t have any font properties. So what you can do is to wrap the DataGridCellPresenter into a contentControl so this way you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alejandrobog.wordpress.com&amp;blog=8405727&amp;post=3&amp;subd=alejandrobog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is how you could change font properties using the VisualStateManager in a Silverlight datagrid.</p>
<p>The main problem is that when trying to edit a copy of the grid style the row content is presented as a DataGridCellPresenter, which doesn&#8217;t have any font properties. So what you can do is to wrap the DataGridCellPresenter into a contentControl so this way you can modify its properties and the  DataGridCellPresenter would inherit them.</p>
<p>Here is an example:</p>
<div><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&lt;</span></span></span></span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">ContentControl</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;"> x</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">:</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;">Name</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;contentControl&#8221;</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;"> Foreground</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;#FF000000&#8243;&gt;<br />
</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">  &lt;</span></span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">Primitives</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">:</span></span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">DataGridCellsPresenter</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;"> x</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">:</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;">Name</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;CellsPresenter&#8221;</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;"> Grid.Column</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;1&#8243;</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;"><br />
                                                                            Primitives</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">:</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;">DataGridFrozenGrid.IsFrozen</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;True&#8221;/&gt;<br />
&lt;/</span></span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">ContentControl</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&gt;<br />
</span></span></div>
<div><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&lt;</span></span></span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">vsm</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">:</span></span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">VisualState</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;"> x</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">:</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;">Name</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;MouseOver&#8221;&gt;<br />
</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">  &lt;</span></span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">Storyboard</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&gt;</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><br />
    </span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&lt;</span></span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">ColorAnimationUsingKeyFrames</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;"> BeginTime</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;00:00:00&#8243;</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;"> Duration</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;00:00:00.0010000&#8243;</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;"><br />
                                                                           Storyboard.TargetName</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;contentControl&#8221;<br />
                                                                           </span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;">Storyboard.TargetProperty</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;(Control.Foreground).(SolidColorBrush.Color)&#8221;&gt;<br />
      </span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&lt;</span></span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">SplineColorKeyFrame</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;"> KeyTime</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;00:00:00&#8243;</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;"> Value</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;#FFE13710E&#8221;/&gt;<br />
    </span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&lt;/</span></span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">ColorAnimationUsingKeyFrames</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&gt;<br />
  </span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&lt;/</span></span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">Storyboard</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&gt;<br />
</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&lt;/</span></span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">vsm</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">:</span></span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">VisualState</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&gt;</span></span></span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;">&lt;<span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">vsm</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">:</span></span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">VisualState</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;"> </span></span> x</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">:</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;">Name</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;Normal Selected&#8221;&gt;<br />
  </span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&lt;</span></span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">Storyboard</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&gt;<br />
    </span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&lt;</span></span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">DoubleAnimationUsingKeyFrames</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;"> Storyboard.TargetName</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;BackgroundRectangle&#8221;</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;"><br />
                                                                               Storyboard.TargetProperty</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;Opacity&#8221;&gt;<br />
      </span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&lt;</span></span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">SplineDoubleKeyFrame</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;"> KeyTime</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;0&#8243;</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;"> Value</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;1&#8243;/&gt;<br />
    </span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&lt;/</span></span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">DoubleAnimationUsingKeyFrames</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&gt;<br />
    </span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&lt;</span></span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">ColorAnimationUsingKeyFrames</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;"> BeginTime</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;00:00:00&#8243;</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;"> Duration</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;00:00:00.0010000&#8243;</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;"><br />
                                                                            Storyboard.TargetName</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;contentControl&#8221;</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;"><br />
                                                                            Storyboard.TargetProperty</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;(Control.Foreground).(SolidColorBrush.Color)&#8221;&gt;<br />
      </span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&lt;</span></span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">SplineColorKeyFrame</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;"> KeyTime</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;00:00:00&#8243;</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;"> Value</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;#FFE12222&#8243;/&gt;<br />
    </span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&lt;/</span></span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">ColorAnimationUsingKeyFrames</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&gt;<br />
  </span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&lt;/</span></span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">Storyboard</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&gt;<br />
</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&lt;/</span></span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">vsm</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">:</span></span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">VisualState</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&gt;</span></span></span></span></div>
<div><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"> </span></span></span></span></div>
<div><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><img class="alignnone size-full wp-image-13" title="Grid" src="http://alejandrobog.files.wordpress.com/2009/07/grid.png?w=278&#038;h=178" alt="Grid" width="278" height="178" /></span></span></span></span></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alejandrobog.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alejandrobog.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alejandrobog.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alejandrobog.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/alejandrobog.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/alejandrobog.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/alejandrobog.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/alejandrobog.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alejandrobog.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alejandrobog.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alejandrobog.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alejandrobog.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alejandrobog.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alejandrobog.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alejandrobog.wordpress.com&amp;blog=8405727&amp;post=3&amp;subd=alejandrobog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://alejandrobog.wordpress.com/2009/07/02/silverlight-datagrid-change-foreground-color-on-visualstatemanagermouseover-selected/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0e1a71fcbf5d673f01bb1469b25a8e3e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alejandrobog</media:title>
		</media:content>

		<media:content url="http://alejandrobog.files.wordpress.com/2009/07/grid.png" medium="image">
			<media:title type="html">Grid</media:title>
		</media:content>
	</item>
	</channel>
</rss>
