wpf user control - prevent code in constructor from running in designer

M

moondaddy

using VS 2008 sp1 and c#, I have a user user control (uc1) which uses
another user control (uc2) in its xaml. When I compile the application and
then view uc1 in the designer, I get the error screen "Problem Loading" and
a blue squiggly under the reference to uc2 in the xaml and the tooltip for
the blue squiggly says "The type 'uc2' was not found...".

In the constructor of uc2 I have replaced the old exception handling with
some new exception handling and this problem began when I started using the
new exception handling. evidently id doesn't like the new exception
handling code/libraries. So I put the following line of code as the first
line in the constructor thinking that it would fix the problem, but it didn't:

if (DesignerProperties.GetIsInDesignMode(this)) { return; }

using this line in the past has helped with other issues in the past such as
preventing code from attempting to connect to a database when viewing
controls in the wpf designer. Can anyone please advise how I can proceed in
trouble shooting this?

everything works OK when I rem out the exception handling code. We've made
a huge investment in the exception handling framework and it needs to stay.

Thanks.
 
A

Andy O'Neill

moondaddy said:
using VS 2008 sp1 and c#, I have a user user control (uc1) which uses
everything works OK when I rem out the exception handling code. We've
made a huge investment in the exception handling framework and it needs to
stay.

I would guess you need a xmlns reference to whatever code you're on about
with "new exeption handling framework."

Where is said code?
 
M

moondaddy

Both uc1 and uc2 are in the same assembly 'UIControls' and the exception
handling are in a different assembly (Ifx), however, the old exception
handling code was in it's own assembly as well and I never had this problem
before, therefore, I don't think I need to reference Ifx in the xaml. Does
this answer your question? any other ideas?

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top