Microsoft Developer Network > Página Inicial dos Fóruns > Visual Studio WPF Designer > WPF Custom Control: Custom control is not visible in the designer + .Net 3.5 SP1 framework
Fazer uma PerguntaFazer uma Pergunta
 

Discussão GeralWPF Custom Control: Custom control is not visible in the designer + .Net 3.5 SP1 framework

  • segunda-feira, 12 de janeiro de 2009 5:33BGan Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    Hi,

    I have designed custom control, which is inherited from 'System.Windows.Controls.Control'. I have defined the theme for it to change its appearance. in the static constuctor I have added following code.

    Static  MyCustomControl (){
                 DefaultStyleKeyProperty.OverrideMetadata(typeof(MyCustomControl),  
                                      new FrameworkPropertyMetadata(typeof(MyCustomControl)));
    }

    When I drag and drop the control, It does not appear in the designer.
    Can any one tell me, What could be the reason for such behavior?


    Regards,
    Bharath


Todas as Respostas

  • quinta-feira, 25 de junho de 2009 10:14g_nicu Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    Hi,

    have you solved this problem? I have it too.

    Nicu
  • terça-feira, 30 de junho de 2009 0:55Mark Wilson-ThomasMSFT, ModeradorMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     

    Hi BGan

    The best way to debug in this situation is to attach a second instance of Visual Studio to the one in which you are attempting to run your Control on the designer. You will then be able to see whether any debug information is shown when you drag-drop your control.

    The most common sources of issue here are that your control's constructor is failing to run; the method above will assist in identifying why.

    Mark


    Mark Wilson-Thomas - Program Team - WPF & SL Designer for Visual Studio - posts are provided 'as-is'