So I have been struggling with this for a while and figured I would post here in case anyone else has a similar challenge.
When creating Sample Data from a class in Expression Blend, the XAML generated will contain values for properties in your class that are read only. This is perfectly acceptable for design time data and / or if you do not want to include the sample data files in your project. However, if you do include the sample data files in your project (maybe to place them under version control so all developers have access to them) and attempt to compile your application, you may receive one or more errors indicating
'Cannot assign 'XXX' into the read only property 'XXXXXXXXXXXX'
My initial solution was to include the sample data files while doing the design and exclude them when compiling.
A better solution I found later lets you keep the sample data files as part of your project but removed the compilation errors. To achieve this, simply right mouse button click on the sample data file (it will have a .xaml extension). From the pop-up menu select properties (usually the last entry in the list). In the properties panel, look for the Build Action entry. It is most likely set to Page or some other value that causes the sample data xaml to be compiled with your application. Change the value for Build Action to None by selecting the 'None' entry from the drop down list. Save, compile and you will no longer receive the compilation error messages about read-only properties.