views:

311

answers:

2

Hi!

I use WPF UserControls to design some part of my application. I'm using blend 2.5 for the graphical part. But when I have a user control into any content, it won't show up in blend and a, exception will be raised, saying that the resource couldn't be located.
My application is localized, I moved my localized DLL into Blend folder.

Here is a piece of code which won't work :

<StackPanel>
     <RadioButton x:Name="radioBasicInfo" Content="{DynamicResource string_newUnitBasicInfo}" Margin="0,0,0,5" Checked="checkErrors"/>
     <content:CoverContent></content:CoverContent>
</StackPanel>

I've googled it but didn't find any solution, and this is very annoying since you cannot see what is the final render into blend.

Hope you can help me. Boris

A: 

There are many different classes of resource errors that Blend can run into, so its hard to say from your description what exactly the problem is.

I'd suggest debugging your application inside of Blend to see what precisely is going on, and where the exceptions are being thrown. You should be able to debug it by opening your project in both Visual Studio and Blend, and then attaching the VS debugger to the Blend application executable. Then you should be able to set VS to stop on all CLR exceptions thrown (or just the reference exception you are seeing), and have the full power of VS and details of the exception to help you figure out where Blend/WPF is looking for those resources so that you can figure out why they are not being found.

Nicholas Armstrong
+1  A: 

It actually came from a localization issue. The resources dll in the blend folder was not up to date and then it didn't find the different xaml references, which is weird because there is no reference to any xaml file into my localized dictionaries...
But maybe I'm something about localization...

I'm quite upset that Microsoft didn't handle localized resources in Blend, hopefully they will fix it in Blend 3.0.

Boris Gougeon