This is one of those quirks that until you try it, you may not know it exists or what the answer is.
I am working on a WPF project and have a separate control library (actually, a module because I am using the Component Application Guidance/PRISM pattern). I pulled it into Expression Blend and was surprised to see that I had no "design" view. The option simply didn't exist/was grayed out in the menu.
So, I did some digging around and it turns out that because my controls file is just a C# class library, Expression doesn't know it is "allowed" to design the controls. To tell it this, you simply need to open your .csproj file that the XAML is in, then add this to the first PropertyGroup tag that you find:
<PropertGroup>
...
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
...
</PropertyGroup>
Just enter it exactly with the same Guids ... now close out of Expression, reload, and voila! you can now design.


Thanks a ton for that tip.
ReplyDeleteSaved my life...
ReplyDeleteI had put this in the main .csproj file, was not aware I had to put in them ALL... cheers!
Hi Jeremy,
ReplyDeleteOver the last 2 years (seems like a lifetime) we've been building a large Silverlight PRISM / MEF application that makes use of dynamically loaded XAP modules and have recently upgraded to Blend 4, VS2010 and Prism 4 and now use MEF.
However when editing a XAML file in Blend, we can't for the life of us see how to enable the XAML editing controls (design view). The objects and timeline is disabled, no states, assets, resources etc.
We've tried the ProjectTypeGuids as above, we've added the existing projects to a new solution but still no joy.
The solution modules were Class Libraries but then we changed the properties of the project indicate Silverlight Application and to output XAP. But being without Blend is a major for styling and creating templates etc.
Do you know what the problem could be?
Thanks - Simon
Do you get any errors when you attempt to edit the controls, or do they just not render/show disabled? Is it just that project, or do other projects show similar behavior? I have a few ideas but more information will help. Thanks!
ReplyDeleteHi Jeremy - as an example our login form works normally in VS2010 - no XAML parser errors, we can work in the design and xaml views no problems, however when we open in Blend we get no design capability at all just the raw XAML. No errors though.
ReplyDelete