VSM not in an extra assembly

May 25, 2009 at 9:29 PM


I would like to include the vsm in my main assembly, but when I do this, I always get an error when I put the vsm  as child of a border when the border has another child.

<Border x:Name="border">
                            <Content of the Control>

VisualStudio tells me that a Border can only have one child.

But when I put the VSM-Stuff in an extra assembly this code runs fine.

Anyone can point me what is going wrong there?

May 26, 2009 at 9:57 PM

Is your Border the root of a template?  If not, that might explain why you're hitting this issue - in the Toolkit, VSM only works inside of a template or a UserControl (ie., you can't set VisualStateGroups directly on a control).  This will change in 4.0, but there are some caveats which I won't get into here (they will be documented on MSDN, though).