I’m developing a Windows Phone 7 app, where I databind an Image Source property, and use a converter to produce the image. Like so:
<Image Source="{Binding Image, Converter={StaticResource MyImageConverter}}"></Image>
This works on the emulator, but crashes the designer, because MyImageConverter has dependencies on other code that is not instantiated by the designer. Is there any way I can make the designer ignore this attribute, or even better, can I specify another Source that is only used by the designer? I’m using Visual Studio 2010, if it matters.
If by ‘designer’ you are referring to Blend or Cider (VS designer), you can use the following to find if you are in design mode or not
Then wrap your code accordingly.