Special characters in xaml

by Scott 17. May 2010 12:48

Here is a quick chart for displaying special characters in xaml

<    &lt;

>    &gt;

&    &amp;

"    &quot;

Tags:

Silverlight

Items collection must be empty before using ItemsSource

by Scott 9. March 2010 11:26

In silverlight or WPF if you get the error:

"Items collection must be empty before using ItemsSource"

make sure you aren't populating the control with both the ItemsSource and adding children to the control in XAML.  In my case, I was setting ItemsSource after a call to a WCF service.  I had mistakingly also added a placeholder object in my XAML until I had written the WCF call.  Oops. 

Hope this helps somebody,

Scott

Tags:

Silverlight

VS 2010 RC problem with missing ObservableCollection for WCF services

by Scott 17. February 2010 14:57

I'm back into Silverlight 3 now after a long break.  Since VS2010 RC was just released, I decided to upgrade my existing SL3 project and enjoy the benefits of a greatly improved IDE.  The project appeared to convert to just fine, but I had compile errors.  It seems my ObservableCollections were now arrays.  When attempting to update/configure a service reference, it chooses ( Custom ) and ObservableCollection is no longer a choice!

Somebody goofed at Microsoft and left out the ObservableCollection type.  To fix, you need to do this:

1.  Choose System.Collections.ObjectModel.Collection as the Collection type (instead of ( Custom )).

2.  Update, or configure your reference

3.  Find the reference.cs (or .vb) file (open windows explorer and find it in your Services References folder)

4.  Change all System.Collections.ObjectModel.Collection to System.Collections.ObjectModel.ObservableCollection.

 

Back in business.  I have no doubt they'll fix this by RTM, but that allows me to work with the RC and Silverlight/WCF.

I hope this helps somebody.  Happy programming.

 

Tags: , ,

Silverlight

About the author

Hi, I'm Scott.  My company develops in C#/ASP.NET/Silverlight and and creates e-commerce web sites for small business.  Visit our corporate site, Gildner Solutions.  We are working on a brand new one now.

RecentComments

Comment RSS