After spending some time skinning applications I have come across a little bug in the system that seems to cause the application to break.

Every time I edit something with the Visual State Manager within Expression Blend, it edits the XAML to a point where the application won’t run.

Here is the error

So there is the error in Visual Studio –
XamlParserException occurred.
DataTemplate does not support Comment as content.

After a little bit of investigation, I found that when i edited the item in VSM, saved it and continued to build and test the application in Visual Studio, it was not building because Blend was changing the XAML to read:

<ItemsControl VerticalAlignment=”Top” x:Name=”Comments” Grid.Row=”1″ >
<my:Comment x:Name=”CommentItem”/>

The problem being the vsm: in front of the DataTemplate tag, it is what was breaking the application and to simply remove it would fix the issue and all my updates worked.

So there is the workaround for the issue but I would love to work out if its a bug or if there is something I can do to avoid it completely.

Any thoughts?