<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-854804325483922825</id><updated>2012-02-16T14:13:10.768-08:00</updated><category term='toolkit'/><category term='spherical mercator'/><category term='openlayers'/><category term='new blog'/><category term='BusyIndicator'/><category term='asynchronous'/><category term='workaround'/><category term='silverlight'/><category term='bug'/><category term='programming'/><category term='IsEditable'/><category term='board games by josh'/><category term='develop'/><category term='kml'/><category term='strange behavior'/><category term='Silverlight 4'/><category term='map'/><category term='DataGrid'/><category term='poor error message'/><category term='Java'/><category term='IDE'/><category term='RejectChanges'/><category term='ChildWindow'/><category term='Groovy'/><category term='board games'/><category term='test'/><category term='WCF ASP.NET MVC REST Web Services'/><category term='unit test'/><category term='ComboBox'/><category term='Validation'/><category term='EnqueueConditional'/><category term='TextBox'/><category term='EnqueueCallback'/><category term='FLEX'/><category term='timeout'/><category term='DataForm'/><category term='namescope'/><category term='.NET'/><title type='text'>Josh the Developer</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jedwards14.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://jedwards14.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Josh Edwards</name><uri>http://www.blogger.com/profile/14011225292134198772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://2.bp.blogspot.com/_tbxXCCui9zc/TU8AP1nJ29I/AAAAAAAAAFQ/BKrYHQuCq_8/s220/board%2Bgame%2Bjosh2.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>15</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-854804325483922825.post-7570311110286233243</id><published>2012-01-04T11:50:00.000-08:00</published><updated>2012-01-04T11:50:54.125-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='poor error message'/><category scheme='http://www.blogger.com/atom/ns#' term='bug'/><category scheme='http://www.blogger.com/atom/ns#' term='namescope'/><title type='text'>"Value does not fall within the expected range." When Adding a Control in Code</title><content type='html'>"Value does not fall within the expected range" is an error I expect to receive when attempting to access an element of an Array that does not exist.&amp;nbsp; Unfortunately, I have spent the last day receiving this message intermittently when trying to perform an Add on a UIElement's Children in Silverlight.&lt;br /&gt;&lt;br /&gt;If you're like me, you received this error and immediately started Googling how to fix it by typing in the error and adding things like "Add" and "Silverlight."&amp;nbsp; If you do this, you'll find a few results - almost exclusively about namescope conflicts.&amp;nbsp; Well, there's a reason - that really is the problem no matter what all of your other investigations point towards.&lt;br /&gt;&lt;br /&gt;Here were my exact symptoms: I was adding a context menu to a Grid dynamically.&amp;nbsp; When the Grid initially loaded, the context menu was added.&amp;nbsp; It was performed this way so that we could have a generic GridBehavior that included the ContextMenu instead of having a hard coded ContextMenu on each of our Grids.&amp;nbsp; However, this code worked fine for years - why did it suddenly break?&lt;br /&gt;&lt;br /&gt;Well, what changed?&amp;nbsp; We had recently performed a merge, and this is when the problem started occurring.&amp;nbsp; So, easy enough - I rolled back all of the GridBehavior changes (this is where the error was actually occurring after all), as well as any other file that seemed to be impacted by the GridBehavior changes (those that didn't build correctly after I rolled the first file back).&amp;nbsp; This would fix it if it were merge related right?&amp;nbsp; Well, no luck - it still failed.&lt;br /&gt;&lt;br /&gt;What else can I try?&amp;nbsp; Well, everything told me that it was about namescope conflicts.&amp;nbsp; So, right before I added the control, I appended a random modifier to the Name - this should fix it, right?&amp;nbsp; No luck.&lt;br /&gt;&lt;br /&gt;What if I check for the Name to be used in the namescope of the parent I was adding it to?&amp;nbsp; Or even the Application's RootVisual?&amp;nbsp; Well - I told you that this error was occurring intermittently, and none of these checks coincided with whether the error would occur or not - they would always be either true or false, but not change based on whether the code blew up.&lt;br /&gt;&lt;br /&gt;Then I noticed something - this control had a name.&amp;nbsp; And it received that name in the XAML.&amp;nbsp; I started thinking about this for a bit, and I wondered how long it had had that name.&amp;nbsp; Checking the history - it received it in that last merge!&amp;nbsp; Therefore, I ripped that name out and started testing again.&amp;nbsp; Lo and behold, everything worked!&lt;br /&gt;&lt;br /&gt;Here's the moral of this story: that error message really is about a namescope conflict.&amp;nbsp; Believe it!&amp;nbsp; It's somewhere in there!&amp;nbsp; Secondly - don't name things in XAML that don't need names - &lt;b&gt;especially&lt;/b&gt; don't do this if you're later going to add them dynamically - you can't guarantee that you'll only add it once instead of multiple times in the namescope!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/854804325483922825-7570311110286233243?l=jedwards14.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jedwards14.blogspot.com/feeds/7570311110286233243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=854804325483922825&amp;postID=7570311110286233243' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/7570311110286233243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/7570311110286233243'/><link rel='alternate' type='text/html' href='http://jedwards14.blogspot.com/2012/01/value-does-not-fall-within-expected.html' title='&quot;Value does not fall within the expected range.&quot; When Adding a Control in Code'/><author><name>Josh Edwards</name><uri>http://www.blogger.com/profile/14011225292134198772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://2.bp.blogspot.com/_tbxXCCui9zc/TU8AP1nJ29I/AAAAAAAAAFQ/BKrYHQuCq_8/s220/board%2Bgame%2Bjosh2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-854804325483922825.post-4859028532197356792</id><published>2011-12-30T10:38:00.000-08:00</published><updated>2011-12-30T10:49:31.498-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ChildWindow'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='bug'/><category scheme='http://www.blogger.com/atom/ns#' term='strange behavior'/><title type='text'>Silverlight Screen Disabling When Closing ChildWindow</title><content type='html'>An obnoxious problem has been plaguing a project that I've been working on for the last couple of months.  As we would be testing various pieces of functionality, the screen would inexplicably become completely disabled.  Now, we were working in a TabbedPane, so it was quite odd that the &lt;i&gt;entire&lt;/i&gt; browser screen was being disabled (and not just our current Tab).  Well, as I'm sure you realize - this is not acceptable production behavior!  So, as we began drawing closer to our release date, this became more of a pressing concern - and so I was able to dedicate several hours to investigating the problem (and now writing this so that I didn't forget the solution!)&lt;br /&gt;&lt;br /&gt;Ok, here are the steps I found to reproduce.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Go to a certain tab&lt;/li&gt;&lt;li&gt;Bring up the ChildWindow&lt;/li&gt;&lt;li&gt; Click the "X" (built in Close) button&lt;/li&gt;&lt;li&gt;Go to a different tab&lt;/li&gt;&lt;li&gt;Bring up a different ChildWindow&lt;/li&gt;&lt;li&gt;Close the new ChildWindow&lt;/li&gt;&lt;li&gt;*poof* your screen was disabled!&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;So, if you're like me, you assume that the problem is in the second ChildWindow - after all, that's the one showing the symptoms... except that it works most of them time - just not when you go to the other ChildWindow first.  &lt;br /&gt;&lt;br /&gt;Anyway, I scoured the Internet looking for anyone that was having any kind of similar problems.  There were people talking about setting both a DialogResult and calling the Close() method, so I looked for that.  Nothing.&lt;br /&gt;&lt;br /&gt;There were people that talked about calling Close() twice (setting DialogResult actually calls Close() so this is really the same as the last problem).  I looked all over the ChildWindow that was exhibiting the symptoms - still nothing.&lt;br /&gt;&lt;br /&gt;What actually happened was that my &lt;b&gt;FIRST&lt;/b&gt; ChildWindow was calling Close() from the Closing event handler, because it was calling an inherited block of code without realizing all of the implications - and this somehow decided to mess up the &lt;i&gt;next&lt;/i&gt; ChildWindow's close operation.  Who knew?&lt;br /&gt;&lt;br /&gt;So, long story short - if you're experiencing a disabling of your main screen when a ChildWindow closes, look for Close() to be called twice - but be mindful of Close() being called on a previous ChildWindow after it is already in the Closing event handler as well!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/854804325483922825-4859028532197356792?l=jedwards14.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jedwards14.blogspot.com/feeds/4859028532197356792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=854804325483922825&amp;postID=4859028532197356792' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/4859028532197356792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/4859028532197356792'/><link rel='alternate' type='text/html' href='http://jedwards14.blogspot.com/2011/12/silverlight-screen-disabling-when.html' title='Silverlight Screen Disabling When Closing ChildWindow'/><author><name>Josh Edwards</name><uri>http://www.blogger.com/profile/14011225292134198772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://2.bp.blogspot.com/_tbxXCCui9zc/TU8AP1nJ29I/AAAAAAAAAFQ/BKrYHQuCq_8/s220/board%2Bgame%2Bjosh2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-854804325483922825.post-3175025504312054099</id><published>2011-11-02T05:43:00.000-07:00</published><updated>2011-11-02T05:43:47.213-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TextBox'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='Validation'/><title type='text'>Validation States on TextBox in Silverlight</title><content type='html'>So, one of the requirements on the project that I'm working on is that we have a Silverlight TextBox that has to display the error balloon/tooltip.  Simple, right?  However, this TextBox is actually just displaying data, and the data is entered through a dialog, not directly as text on the screen.  Furthermore, to ensure that the user does not attempt to enter the data directly, the TextBox is disabled.&lt;br /&gt;&lt;br /&gt;You may know where I'm going with this - my Validation Error tooltip never appears!  Why?  The default style of a TextBox &lt;i&gt;only shows the tooltip in a focused state&lt;/i&gt;!  Eventually, I realized this.  After looking in the &lt;a href="http://msdn.microsoft.com/en-us/library/cc645061%28v=vs.95%29.aspx"&gt;MSDN documentation about TextBox&lt;/a&gt;, I was able to get the default style of a TextBox, and I was able to override it's InvalidUnfocused state to do the same as the InvalidFocused state - and it worked!&lt;br /&gt;&lt;br /&gt;Now to find a more intuitive way for the user to see that error message without it always being on the screen...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/854804325483922825-3175025504312054099?l=jedwards14.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jedwards14.blogspot.com/feeds/3175025504312054099/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=854804325483922825&amp;postID=3175025504312054099' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/3175025504312054099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/3175025504312054099'/><link rel='alternate' type='text/html' href='http://jedwards14.blogspot.com/2011/11/validation-states-on-textbox-in.html' title='Validation States on TextBox in Silverlight'/><author><name>Josh Edwards</name><uri>http://www.blogger.com/profile/14011225292134198772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://2.bp.blogspot.com/_tbxXCCui9zc/TU8AP1nJ29I/AAAAAAAAAFQ/BKrYHQuCq_8/s220/board%2Bgame%2Bjosh2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-854804325483922825.post-2115032910991435538</id><published>2011-09-25T07:56:00.000-07:00</published><updated>2011-09-25T07:56:53.852-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DataForm'/><category scheme='http://www.blogger.com/atom/ns#' term='DataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='RejectChanges'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><title type='text'>Why is my Silverlight DataForm acting like that?</title><content type='html'>The other day, as I was using Silverlight, I put a DataGrid inside of a DataForm.  Seems innocent enough, right?  Specifically, what I wanted to accomplish was to allow users to add elements to a DataGrid with drag and drop functionality.  Therefore, there were two DataGrids - one that the user dragged from, and the other that would receive the drop event.  What I noticed, though, was that the added elements were not being saved.  &lt;br /&gt;&lt;br /&gt;We are using WCF RIA services, so I first assumed that I had created my composition objects incorrectly, and so I spent quite a bit of time looking into and verifying that code.  After adding more and more breakpoints, I discovered that the WCF RIA service call was not to blame - the added elements were not even in the Submit operation, and so they were being removed sometime before the Submit was called.  &lt;br /&gt;&lt;br /&gt;Next, life got even more strange - if I edited one of the DataFields on the DataGrid, and then I dragged an item over, everything saved correctly.  This left me quite puzzled.  Then, eventually, a co-worker helped me discover the problem (which I thought was strange enough to warrant a blog post - maybe this will help other people (or even myself) next time one of us runs into this situation).&lt;br /&gt;&lt;br /&gt;&lt;b&gt;A Silverlight DataForm Rejects changes on EditEnded.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;What?  Yeah, I thought that this was quite strange.  Why was I hitting this event?  My "Save" button was not in the DataGrid!  However, once you know this, it is easy enough to fix.  Handle the EditEnding event on the DataForm and mark the event canceled:&lt;br /&gt;&lt;br /&gt;private void DataForm_EditEnding(object sender, DataFormEditEndingEventArgs e)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.Cancel = true;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Done!  Now my DataForm stopped rejecting my changes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/854804325483922825-2115032910991435538?l=jedwards14.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jedwards14.blogspot.com/feeds/2115032910991435538/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=854804325483922825&amp;postID=2115032910991435538' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/2115032910991435538'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/2115032910991435538'/><link rel='alternate' type='text/html' href='http://jedwards14.blogspot.com/2011/09/why-is-my-silverlight-dataform-acting.html' title='Why is my Silverlight DataForm acting like that?'/><author><name>Josh Edwards</name><uri>http://www.blogger.com/profile/14011225292134198772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://2.bp.blogspot.com/_tbxXCCui9zc/TU8AP1nJ29I/AAAAAAAAAFQ/BKrYHQuCq_8/s220/board%2Bgame%2Bjosh2.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-854804325483922825.post-4003270808541048665</id><published>2011-07-05T14:37:00.000-07:00</published><updated>2011-07-05T14:37:53.946-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DataForm'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='Validation'/><title type='text'>Making Values Required in a Silverlight DataForm</title><content type='html'>For those of you who have done validation in a Silverlight DataForm before, you probably are used to setting the [Required] attribute above all of the necessary fields in your WCF RIA project.  From there, .NET will auto-magic the necessary code and, combined with lots of NotifyOnValidationError and ValidatesOnExceptions tags (and potentially some GetBindingExpression(&lt;blah&gt;).UpdateSource()), viola! it will successfully perform validations.  However, I ran into a situation where I was actually taking a couple of fields and transforming them into a single field from my WCF RIA service data object.  After a long time of scratching my head, I was really stuck on trying to figure out how to force this validation to work.  I had tried setting the [Required] attribute on the field they were bound to, added all the usual NotifyOnValidationError tags... nothing. &lt;br /&gt;&lt;br /&gt;Eventually, I realized how to get around this issue (and it made me feel a bit silly for not coming up with this earlier.)  You know where we set "ValidatesOnExceptions=true"... well... let's throw a ValidationException!  So, in the setter of the property that I was binding the DataField to, if the data was invalid, I simply threw a ValidationException.  Poof!  It suddenly started working.  Is there a better way to do this?  Probably.  However, this was able to get me back on the right path, and I was able to resume being productive.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/854804325483922825-4003270808541048665?l=jedwards14.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jedwards14.blogspot.com/feeds/4003270808541048665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=854804325483922825&amp;postID=4003270808541048665' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/4003270808541048665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/4003270808541048665'/><link rel='alternate' type='text/html' href='http://jedwards14.blogspot.com/2011/07/making-values-required-in-silverlight.html' title='Making Values Required in a Silverlight DataForm'/><author><name>Josh Edwards</name><uri>http://www.blogger.com/profile/14011225292134198772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://2.bp.blogspot.com/_tbxXCCui9zc/TU8AP1nJ29I/AAAAAAAAAFQ/BKrYHQuCq_8/s220/board%2Bgame%2Bjosh2.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-854804325483922825.post-9144846370838961530</id><published>2011-04-01T13:48:00.000-07:00</published><updated>2011-04-01T13:48:04.274-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TextBox'/><category scheme='http://www.blogger.com/atom/ns#' term='DataForm'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='Validation'/><title type='text'>Systematically Update Binding in Silverlight</title><content type='html'>So, after quite a bit of time in Silverlight, I have learned that DataForms are very powerful entities.&amp;nbsp; However, they like to hide from me what they are doing.&amp;nbsp; Therefore, when I get into a situation in which I need to simulate their behavior, this often ends with me banging my head against a wall and typing my query into Google in as many different ways as possible.&amp;nbsp; Recently, I have been attempting to force a validation on an object that was &lt;i&gt;not&lt;/i&gt; in a DataForm... and I had no idea how.&amp;nbsp; Fortunately, I stumbled upon this &lt;a href="http://forums.silverlight.net/forums/p/158594/355147.aspx%22"&gt;forum&lt;/a&gt; and it helped me.&amp;nbsp; So that you don't have to bother reading it (that's why you're at my site, anyway, isn't it?) I have placed the important code snippet here:&lt;br /&gt;&lt;br /&gt;BindingExpression bindingExpression = myTextBox.GetBindingExpresion(TextBox.TextProperty);&lt;br /&gt;bindingExpression.UpdateSource();&lt;br /&gt;&lt;br /&gt;Poof!&amp;nbsp; Your TextBox (assuming your TextBox variable is called "myTextBox") will validate.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/854804325483922825-9144846370838961530?l=jedwards14.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jedwards14.blogspot.com/feeds/9144846370838961530/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=854804325483922825&amp;postID=9144846370838961530' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/9144846370838961530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/9144846370838961530'/><link rel='alternate' type='text/html' href='http://jedwards14.blogspot.com/2011/04/systematically-update-binding-in.html' title='Systematically Update Binding in Silverlight'/><author><name>Josh Edwards</name><uri>http://www.blogger.com/profile/14011225292134198772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://2.bp.blogspot.com/_tbxXCCui9zc/TU8AP1nJ29I/AAAAAAAAAFQ/BKrYHQuCq_8/s220/board%2Bgame%2Bjosh2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-854804325483922825.post-7577370357571183043</id><published>2011-02-17T11:09:00.000-08:00</published><updated>2011-02-22T06:59:02.924-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DataForm'/><category scheme='http://www.blogger.com/atom/ns#' term='BusyIndicator'/><category scheme='http://www.blogger.com/atom/ns#' term='toolkit'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='workaround'/><title type='text'>Silverlight Data Forms with BusyIndicator</title><content type='html'>So, I'm sure that this has been posted elsewhere, but I don't really remember where, so I figured I would re-post it if for no other reason than it would allow me to find it again.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When using Silverlight 4 with the toolkit, I ran into an interesting bug.&amp;nbsp; Sometimes when I would use a DataForm along with the toolkit's BusyIndicator, the DataForm would appear to be disabled, even after the BusyIndicator was no longer showing.&amp;nbsp; (To see more about the bug itself, you can go &lt;a href="http://silverlight.codeplex.com/workitem/4729"&gt;here&lt;/a&gt;.)&amp;nbsp; After discovering what the issue was, I researched on Google how I should fix this.&amp;nbsp; As it turns out, it is a pretty simple fix. I simply added the following (note that DataForm is the variable name of the DataForm in my XAML):&lt;br /&gt;&lt;br /&gt;DataForm.IsEnabledChanged += new DependencyPropertyChangedEventHandler(DataForm_IsEnabledChanged);&lt;br /&gt;&lt;br /&gt;and&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; void DataForm_IsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!IsEnabled)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VisualStateManager.GoToState(DataForm, "Disabled", true);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VisualStateManager.GoToState(DataForm, "Normal", true);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Poof!&amp;nbsp; The code was able to go back to the correct state.&amp;nbsp; Hopefully Microsoft will fix this so that this workaround is no longer required, but in the meantime, I figured it might help someone to see this.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/854804325483922825-7577370357571183043?l=jedwards14.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jedwards14.blogspot.com/feeds/7577370357571183043/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=854804325483922825&amp;postID=7577370357571183043' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/7577370357571183043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/7577370357571183043'/><link rel='alternate' type='text/html' href='http://jedwards14.blogspot.com/2011/02/silerlight-data-forms-with.html' title='Silverlight Data Forms with BusyIndicator'/><author><name>Josh Edwards</name><uri>http://www.blogger.com/profile/14011225292134198772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://2.bp.blogspot.com/_tbxXCCui9zc/TU8AP1nJ29I/AAAAAAAAAFQ/BKrYHQuCq_8/s220/board%2Bgame%2Bjosh2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-854804325483922825.post-7189054483019331769</id><published>2010-12-15T14:46:00.000-08:00</published><updated>2010-12-15T14:46:30.437-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DataForm'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='ComboBox'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 4'/><category scheme='http://www.blogger.com/atom/ns#' term='IsEditable'/><title type='text'>Silverlight DataForms with IsEditable</title><content type='html'>This may be something that everyone else knows already, but since this tripped me up for a little while, I figured I might as well post a blog about it.&lt;br /&gt;&lt;br /&gt;Today, as I was tweaking one of our DataTemplates that was being used in a DataForm in Silverlight 4, I was running into a problem related to the IsEditable property.&amp;nbsp; I had a ComboBox in my template, and I tried everything I could to get it to be read-only (I needed it to be read-only only some of the time - depending on what was set in a different property).&amp;nbsp; After eventually thinking maybe my binding was broken, even though I saw it call the get of my property, I tried hard coding IsEnabled to false.&amp;nbsp; Still to no avail - it kept being editable (much to my chagrin).&amp;nbsp; Eventually, after reading about how DataForms worked, I came up with an idea - I put the IsEnabled binding on the DataField tag instead of on the ComboBox itself.&amp;nbsp; Sure enough, poof! it instantly started working and my ComboBox was enabled or disabled depending on the value that my DataField was bound to.&lt;br /&gt;&lt;br /&gt;Hopefully this helps someone who runs into a similar problem.&amp;nbsp; As a sidenote, I also discovered during my testing that you can set something inside a DataForm to be read only by changing the Editable attribute on the property that is being bound to.&amp;nbsp; This wouldn't work in my situation, however, since whether the value was read only or not was dependent on the value of another property, so it made the attribute route more tricky.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/854804325483922825-7189054483019331769?l=jedwards14.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jedwards14.blogspot.com/feeds/7189054483019331769/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=854804325483922825&amp;postID=7189054483019331769' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/7189054483019331769'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/7189054483019331769'/><link rel='alternate' type='text/html' href='http://jedwards14.blogspot.com/2010/12/silverlight-dataforms-with-iseditable.html' title='Silverlight DataForms with IsEditable'/><author><name>Josh Edwards</name><uri>http://www.blogger.com/profile/14011225292134198772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://2.bp.blogspot.com/_tbxXCCui9zc/TU8AP1nJ29I/AAAAAAAAAFQ/BKrYHQuCq_8/s220/board%2Bgame%2Bjosh2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-854804325483922825.post-7443799698035263073</id><published>2010-11-02T06:29:00.000-07:00</published><updated>2010-11-02T06:29:15.125-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='new blog'/><category scheme='http://www.blogger.com/atom/ns#' term='board games by josh'/><category scheme='http://www.blogger.com/atom/ns#' term='board games'/><title type='text'>New Blog</title><content type='html'>Just for those of you that are interested, I have created a new blog at the following link: &lt;a href="http://jedwards14thegamer.blogspot.com/"&gt;http://jedwards14thegamer.blogspot.com&lt;/a&gt;   This will be a personal (non-technical) blog.  One of my primary hobbies is playing board games, and so I will be reviewing games that I play on that blog.  If you are interested in board games, feel free to follow that one, too!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/854804325483922825-7443799698035263073?l=jedwards14.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jedwards14.blogspot.com/feeds/7443799698035263073/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=854804325483922825&amp;postID=7443799698035263073' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/7443799698035263073'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/7443799698035263073'/><link rel='alternate' type='text/html' href='http://jedwards14.blogspot.com/2010/11/new-blog.html' title='New Blog'/><author><name>Josh Edwards</name><uri>http://www.blogger.com/profile/14011225292134198772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://2.bp.blogspot.com/_tbxXCCui9zc/TU8AP1nJ29I/AAAAAAAAAFQ/BKrYHQuCq_8/s220/board%2Bgame%2Bjosh2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-854804325483922825.post-3779204535935318027</id><published>2010-10-15T09:42:00.000-07:00</published><updated>2010-10-19T06:26:14.509-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EnqueueConditional'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='test'/><category scheme='http://www.blogger.com/atom/ns#' term='asynchronous'/><category scheme='http://www.blogger.com/atom/ns#' term='unit test'/><category scheme='http://www.blogger.com/atom/ns#' term='EnqueueCallback'/><title type='text'>Asynchronous Silverlight Unit Tests</title><content type='html'>So, after beginning to do some unit testing of View Models in Silverlight, I discovered that there have not been that many articles written about how to do this.  Fortunately, I did find &lt;a&gt;http://www.jeff.wilcox.name/2009/03/asynchronous-testing/&lt;/a&gt; but other than that, most of what I have learned has been by trial and error.  Therefore, here are my findings.  Hopefully this will help someone else.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1.  "Asynchronous" is a bit of a misnomer.  Think of all of the "Enqueue" commands as "Do this later".  In traditional asynchronous processing, if you fire off something like an "EnqueueConditional" command, it will fire off a new thread that will begin executing immediately.  This is not the case with the Silverlight unit tests.  Here is what I did as an example:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;[TestMethod]&lt;br /&gt;[Asynchronous]&lt;br /&gt;[Description("Whatever")]&lt;br /&gt;public void TestMethod()&lt;br /&gt;{&lt;br /&gt;  int x = 0;&lt;br /&gt;  EnqueueConditional(() =&gt; x == 2);&lt;br /&gt;  EnqueueCallback(() =&gt; { method1(); });&lt;br /&gt;  x = 1;&lt;br /&gt;  EnqueueConditional(() =&gt; x == 1);&lt;br /&gt;  EnqueueCallback(() =&gt; { method2(); });&lt;br /&gt;  x = 2;&lt;br /&gt;  EnqueueTestComplete();&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Now, what I would expect would be that method2 would be called before method1.  After all, x == 1 as soon as the 2nd condition is enqueued.  However, as I said earlier "Enqueue" should be thought of as "do this later".  Therefore, what actually will happen is that method1 will be called (because at the end of the method's synchronous processing x == 2), and method2 will never be called (because x != 1 ever again in the method - also, this will never get to the TestComplete, and so will be an infinite test, just so you're warned).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2.  "EnqueueConditional" basically means "wait until".  This seems to be the most important piece of the processing.  This is the key that will allow you to ensure that a condition is met.  After this happens, all of the EnqueueCallbacks (including EnqueueTestComplete) are executed until the new "EnqueueConditional", which will then perform another wait until the condition is completed.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3.  "EnqueueCallback" just allows code to be done later.  The "later" is driven based off of the EnqueueConditionals.  Consider the following code snippet:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;[TestMethod]&lt;br /&gt;[Asynchronous]&lt;br /&gt;[Description("TestMethod2")]&lt;br /&gt;public void TestMethod2()&lt;br /&gt;{&lt;br /&gt;  int x = 0;&lt;br /&gt;  EnqueueCallback(() =&gt; x = 2);&lt;br /&gt;  x = 1;&lt;br /&gt;  EnqueueConditional(() =&gt; x == 2);&lt;br /&gt;  EnqueueTestComplete();&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;In this situation, the EnqueueCallback has nothing that it has to wait on, but since it is an "EnqueueCallback", it will not execute until the end of the method.  It will function the same as if I had written the code this way:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;[TestMethod]&lt;br /&gt;[Asynchronous]&lt;br /&gt;[Description("TestMethod2")]&lt;br /&gt;public void TestMethod2()&lt;br /&gt;{&lt;br /&gt;  int x = 0;&lt;br /&gt;  x = 1;&lt;br /&gt;  EnqueueConditional(() =&gt; x == 2);&lt;br /&gt;  EnqueueTestComplete();&lt;br /&gt;  x = 2;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/854804325483922825-3779204535935318027?l=jedwards14.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jedwards14.blogspot.com/feeds/3779204535935318027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=854804325483922825&amp;postID=3779204535935318027' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/3779204535935318027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/3779204535935318027'/><link rel='alternate' type='text/html' href='http://jedwards14.blogspot.com/2010/10/asynchronous-silverlight-unit-tests.html' title='Asynchronous Silverlight Unit Tests'/><author><name>Josh Edwards</name><uri>http://www.blogger.com/profile/14011225292134198772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://2.bp.blogspot.com/_tbxXCCui9zc/TU8AP1nJ29I/AAAAAAAAAFQ/BKrYHQuCq_8/s220/board%2Bgame%2Bjosh2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-854804325483922825.post-282451094798260370</id><published>2010-09-01T06:09:00.000-07:00</published><updated>2010-09-01T06:20:09.895-07:00</updated><title type='text'>The Importance of Unit Testing</title><content type='html'>So, a while back, a friend and I started working on developing a game in a new language, mainly as a means of learning that language.  Because of this, it didn't really matter how well the code was written, or if we tested it all that thoroughly.  However, once our code seemed pretty stable, we decided to go ahead and open it up to the Open Source community.  At this point, we started getting reports of some weird errors that we had never seen.&lt;br /&gt;&lt;br /&gt;As it turns out, we had tested our game within the confines of what "normally" happens in a game, and in those situations, everything worked out fine.  What we did not test is what happens when something "abnormal" happens, ie, the game runs out of money, the game is especially high scoring, etc.  Now, of course, these do not often happen - in fact, we did not even think about them.  Also, since we simply had a stack trace, it was at first confusing to try to hunt these bugs down, as the piece of code looked correct.  Had we written unit tests to test both positive and negative test conditions, then theoretically, we would have caught this and our users wouldn't have had to report it.  Realistically, however, you can't catch everything.  Needless to say, there are unit tests for these conditions now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/854804325483922825-282451094798260370?l=jedwards14.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jedwards14.blogspot.com/feeds/282451094798260370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=854804325483922825&amp;postID=282451094798260370' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/282451094798260370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/282451094798260370'/><link rel='alternate' type='text/html' href='http://jedwards14.blogspot.com/2010/09/importance-of-unit-testing.html' title='The Importance of Unit Testing'/><author><name>Josh Edwards</name><uri>http://www.blogger.com/profile/14011225292134198772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://2.bp.blogspot.com/_tbxXCCui9zc/TU8AP1nJ29I/AAAAAAAAAFQ/BKrYHQuCq_8/s220/board%2Bgame%2Bjosh2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-854804325483922825.post-8918530465222352706</id><published>2010-07-30T06:03:00.000-07:00</published><updated>2010-07-30T07:09:42.120-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WCF ASP.NET MVC REST Web Services'/><title type='text'>REST Services in WCF and ASP.NET MVC</title><content type='html'>So, recently my team has started a project with a large base of legacy code, causing us to switch from the Java world, in which we have a large amount of experience to the .NET world in which we are much more limited.  In doing this, one of the first things we needed to determine was how we were going to create Web Services, and if they were going to be in REST or SOAP.  After some banter about SOAP and REST, we decided to use REST for now, delivering the responses in JSON.  The next obvious question was, how are we going to implement the REST services.  Here are the two ways that we have gotten them implemented so far:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;ASP.NET MVC:&lt;/b&gt;&lt;br /&gt;To do this, we simply created a new ASP.NET MVC 2 Application.  From here, it was a simple matter of adding a Controller to the Controllers folder, and viola, we had a REST Service.  The next thing we had to do was to make it return the response in JSON.  This was another fairly simple matter, and eventually, we had a method returning an "ActionResult" and ending with this line:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;return Json(result, JsonRequestBehavior.AllowGet);&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;We were disappointed that result had to be an actual object instead of a dynamic object, however (unless we just haven't figured out how to get around that).&lt;br /&gt;&lt;br /&gt;We did run into a couple of lessons on this, though:&lt;br /&gt;&lt;br /&gt;1.  This works great with IIS 7 (and much less great with anything before it).  To get around this, we have used wildcard extensions for now.  If you are getting 404 errors when trying to hit your Controllers in IIS, but everything works while debugging, Google this, as it will help.&lt;br /&gt;&lt;br /&gt;2.  Our controller's method really likes being called "Index".  I'm sure there's a configuration where we can change this, but we have realized that configurations can be hard to find in .NET.&lt;br /&gt;&lt;br /&gt;3.  When deploying, there seem to be a large number of files that are always necessary, instead of neatly bundling into a single artifact.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;WCF:&lt;/b&gt;&lt;br /&gt;To create a service in WCF is just as simple as creating one in MVC.  Just create a new WCF project, and *poof* you have a Web Service.  Unfortunately, it's SOAP.  To get around this, you have to perform some configuration of your Web.config file.  I don't understand all of it, but in the end, this is what I came up with that worked for ours (note that this is just the Services and Behavior tags inside of the system.serviceModel tag - this is not the whole file):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;services&amp;gt;&lt;br /&gt;      &amp;lt;service name="RestLayerInWCF.Service1"&amp;gt;&lt;br /&gt;        &amp;lt;endpoint &lt;br /&gt;          behaviorConfiguration="webby" binding="webHttpBinding" bindingConfiguration=""&lt;br /&gt;          name="Rest" contract="RestLayerInWCF.IService1" /&amp;gt;&lt;br /&gt;      &amp;lt;/service&amp;gt;&lt;br /&gt;    &amp;lt;/services&amp;gt;&lt;br /&gt;    &amp;lt;behaviors&amp;gt;&lt;br /&gt;      &amp;lt;endpointBehaviors&amp;gt;&lt;br /&gt;        &amp;lt;behavior name="webby"&amp;gt;&lt;br /&gt;          &amp;lt;webHttp/&amp;gt;&lt;br /&gt;        &amp;lt;/behavior&amp;gt;&lt;br /&gt;      &amp;lt;/endpointBehaviors&amp;gt;&lt;br /&gt;    &amp;lt;/behaviors&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Also, we had to mark our services with an extra line:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;[WebGet(UriTemplate = "/", BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = System.ServiceModel.Web.WebMessageFormat.Json)]&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;We had some observations about this one, too:&lt;br /&gt;&lt;br /&gt;1.  The Web.config is a pain to figure out the first time.&lt;br /&gt;&lt;br /&gt;2.  You have to maintain both an Interface and an implementation of each Service.&lt;br /&gt;&lt;br /&gt;3.  You seem to have to type the .svc to navigate to the service instead of having the freedom to name your service whatever you want.&lt;br /&gt;&lt;br /&gt;4.  An interesting thing we noticed is that the return of JSON is smarter than I thought.  I had a problem here where my method signature returned a string, and so I was converting things to Json to return.  This caused them to all return the quotes as \".  Instead, I should have just let the method "do it's thing" and return the original object - it converts it to Json for me.&lt;br /&gt;&lt;br /&gt;Anyway, now we have the tough decision to make - which one are we going to use?  I have no idea....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/854804325483922825-8918530465222352706?l=jedwards14.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jedwards14.blogspot.com/feeds/8918530465222352706/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=854804325483922825&amp;postID=8918530465222352706' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/8918530465222352706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/8918530465222352706'/><link rel='alternate' type='text/html' href='http://jedwards14.blogspot.com/2010/07/rest-services-in-wcf-and-aspnet-mvc.html' title='REST Services in WCF and ASP.NET MVC'/><author><name>Josh Edwards</name><uri>http://www.blogger.com/profile/14011225292134198772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://2.bp.blogspot.com/_tbxXCCui9zc/TU8AP1nJ29I/AAAAAAAAAFQ/BKrYHQuCq_8/s220/board%2Bgame%2Bjosh2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-854804325483922825.post-8438083418089559635</id><published>2009-08-05T14:09:00.000-07:00</published><updated>2009-08-05T14:15:30.167-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='timeout'/><category scheme='http://www.blogger.com/atom/ns#' term='FLEX'/><title type='text'>Dangers of setTimeout in Flex</title><content type='html'>So, after fighting a memory leak in Flex for the last week, I have learned a valuable lesson that hopefully will help.  The setTimeout method in Flex is dangerous.  It turns out that it is not automatically garbage collected when your Flex app is in operation (indeed, I don't even know of a manual way to force it to be garbage collected).  Here was my situation:&lt;br /&gt;&lt;br /&gt;I needed a clock that would increment itself every second.  To do this, I created a little method called runClock that simply updated the time on the clock face and then had a setTimeout(1000, runClock).  Without realizing what I had done, I was now creating a new Object every second that was never reclaimed by the Flex garbage collection process.&lt;br /&gt;&lt;br /&gt;What I should have done (and what I now have) is a Timer.  I have simply set my Timer to fire every 1000 ms, to call runClock and to run indefinitely.  Problem solved and memory leak patched!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/854804325483922825-8438083418089559635?l=jedwards14.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jedwards14.blogspot.com/feeds/8438083418089559635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=854804325483922825&amp;postID=8438083418089559635' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/8438083418089559635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/8438083418089559635'/><link rel='alternate' type='text/html' href='http://jedwards14.blogspot.com/2009/08/dangers-of-settimeout-in-flex.html' title='Dangers of setTimeout in Flex'/><author><name>Josh Edwards</name><uri>http://www.blogger.com/profile/14011225292134198772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://2.bp.blogspot.com/_tbxXCCui9zc/TU8AP1nJ29I/AAAAAAAAAFQ/BKrYHQuCq_8/s220/board%2Bgame%2Bjosh2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-854804325483922825.post-5060547469169656360</id><published>2009-06-19T16:43:00.001-07:00</published><updated>2009-06-19T16:50:21.628-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='develop'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Groovy'/><title type='text'>A Pragmatic look at the Groovy-ness of Groovy</title><content type='html'>So, now that I've been familiar with Groovy for a while, I figured that I would post a blog about my opinions of it from a pragmatic perspective.&lt;br /&gt;&lt;br /&gt;First off, I think that Groovy is an awesome language, and development in it allows code to be much more streamlined, and it is wonderful to finally be able to give up on some of the nuisances of Java.  My favorite part is the ?, but I also enjoy only writing try-catches when I actually intend to catch an Exception, not writing getters and setters, and the metaClass ability is like finding a superpower.  However, life is not all good in Groovy-land.&lt;br /&gt;&lt;br /&gt;There is another tool in my development arsenal that is at least as powerful as Groovy, and which also enhances my development speed.  This tool is code complete.  Unfortunately, these two tools are currently mutually exclusive.  I know that Groovy is dynamic, but when I specifically set a variable type declaration, you would think that my IDE should at least be able to kick into Java mode and tell me what the methods of String are without me having to type them manually or look up the oft-forgotten ones in the JDK.  But lo and behold, it appears that none of the IDEs have found a way around this hicup yet.&lt;br /&gt;&lt;br /&gt;The grand conclusion!  Again - I like Groovy.  But in a real world environment, before I develop a new class, I have to look at which tool will help me develop my code faster and maintain it more easily in the long run.  So far, it appears that the main purpose of Groovy in my life will be to writing very brief classes, writing unit tests, and working with XML.  Hopefully my IDEs will develop, and I'll be able to use both of these tools at the same time sometime in the near future.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/854804325483922825-5060547469169656360?l=jedwards14.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jedwards14.blogspot.com/feeds/5060547469169656360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=854804325483922825&amp;postID=5060547469169656360' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/5060547469169656360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/5060547469169656360'/><link rel='alternate' type='text/html' href='http://jedwards14.blogspot.com/2009/06/pragmatic-look-at-groovy-ness-of-groovy.html' title='A Pragmatic look at the Groovy-ness of Groovy'/><author><name>Josh Edwards</name><uri>http://www.blogger.com/profile/14011225292134198772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://2.bp.blogspot.com/_tbxXCCui9zc/TU8AP1nJ29I/AAAAAAAAAFQ/BKrYHQuCq_8/s220/board%2Bgame%2Bjosh2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-854804325483922825.post-6807981537835354335</id><published>2008-11-11T09:10:00.000-08:00</published><updated>2008-11-11T09:28:35.869-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='map'/><category scheme='http://www.blogger.com/atom/ns#' term='openlayers'/><category scheme='http://www.blogger.com/atom/ns#' term='kml'/><category scheme='http://www.blogger.com/atom/ns#' term='spherical mercator'/><title type='text'>Spherical Mercator - Because the World Really is Flat</title><content type='html'>So, recently I have been working with OpenLayers and KML, just learning each of the technologies, and I discovered something odd.  When I added a KML path as a Layer on my OpenLayers, my path liked to move around.  No matter where the map was centered, the path was in the same place in the window.  That is when I started investigating spherical mercator.  Its not too tough to add, and it will quickly fix this problem.  Basically, what is happening is that your map is round, but your KML is flat.  You will need to fix this by making both of them flat. &lt;br /&gt;&lt;br /&gt;Here are the basics that you need:&lt;br /&gt;&lt;br /&gt;var map = new OpenLayers.Map(('map'), &lt;br /&gt;{projection: new OpenLayers.Projection("EPSG:900913"),             displayProjection: new OpenLayers.Projection("EPSG:4326"),            units: "m",            &lt;br /&gt;maxExtent: new OpenLayers.Bounds(-20037508, -2003750, 20037508, 20037508.34)});&lt;br /&gt;&lt;br /&gt;var mapService = new OpenLayers.Layer.Google( "Google", { sphericalMercator: true, type: G_PHYSICAL_MAP } );&lt;br /&gt;&lt;br /&gt;map.addLayer(mapService);&lt;br /&gt;&lt;br /&gt;map.addLayer(new OpenLayers.Layer.GML("KML", &lt;br /&gt;"http://youraddress/kmlFile.kml",               &lt;br /&gt;{projection: map.displayProjection,&lt;br /&gt;format: OpenLayers.Format.KML,&lt;br /&gt;formatOptions: {extractStyles: true,&lt;br /&gt;extractAttributes: true}}));&lt;br /&gt;&lt;br /&gt;Once you've added this, now your path (or whatever KML you want to use) should stay in place, and you're done.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/854804325483922825-6807981537835354335?l=jedwards14.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jedwards14.blogspot.com/feeds/6807981537835354335/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=854804325483922825&amp;postID=6807981537835354335' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/6807981537835354335'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/854804325483922825/posts/default/6807981537835354335'/><link rel='alternate' type='text/html' href='http://jedwards14.blogspot.com/2008/11/spherical-mercator-because-world-really.html' title='Spherical Mercator - Because the World Really is Flat'/><author><name>Josh Edwards</name><uri>http://www.blogger.com/profile/14011225292134198772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://2.bp.blogspot.com/_tbxXCCui9zc/TU8AP1nJ29I/AAAAAAAAAFQ/BKrYHQuCq_8/s220/board%2Bgame%2Bjosh2.jpg'/></author><thr:total>0</thr:total></entry></feed>
