locked
Open ProjectItem in Designer view does not work as expected RRS feed

  • Question

  • In our internal framework which is C# project we are using wizards for Visual Studio.

    In Visual Studio 2010 all works fine. When we made our framework solution migration to Visual Studio 2013 we get some problems.
    After migration, particular Wizard is still working fine in Visual Studio 2010 but the problem is when wizard is running in Visual Studio 2013.
    The problem is when we want through wizard programmatically open Component in designer view. The Component actually opens but in text view. 

    Code:

     var loProjectItemDesigner = loWizardContext.ProjectItems.AddFromFile(loWizardParameters.FullDesignerFileName);
     loProjectItemDesigner.Properties.Item("SubType").Value = "Component";
    // Open DALC file in designer
    var loWindowDalc = loProjectItemDesigner.Open(EnvDTE.Constants.vsViewKindDesigner);
    loWindowDalc.Activate();

    var loDesignerHost = (IDesignerHost)aoWindowDalc.Object;
    var loComponent = (Component)loDesignerHost.RootComponent;

     var loPropertyGenerator = new SqlDalcPropertyGenerator(aoWizardParameters);
     loPropertyGenerator.SetProperties(loComponent);

    Is there some workaroud or some other way to get component or designer host?

    Thanks.

    Best Regards.

    Uroš

    Thursday, October 24, 2013 9:30 AM

Answers

  • Hi woča,

    I have searched a lot and read your question for several times. However, I don't find anything wrong and I don't have the test tool.

    First, you can write a simple sample using Constants.vsViewKindDesigner Field to view in Visual Designer with visual studio 2013. If it really can not view in designer, please post your issue on connect. If it can, all I can suggest is that you try to identify the relevant source code and differentiate between the 2010 and 2013 versions. Once you know what the problem is, a fix may be apparent.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.




    • Edited by Anna Cc Thursday, October 31, 2013 7:14 AM
    • Proposed as answer by Anna Cc Monday, November 4, 2013 8:32 PM
    • Marked as answer by Anna Cc Tuesday, November 5, 2013 7:29 AM
    Friday, October 25, 2013 10:36 AM

All replies

  • Hi woča,

    I have searched a lot and read your question for several times. However, I don't find anything wrong and I don't have the test tool.

    First, you can write a simple sample using Constants.vsViewKindDesigner Field to view in Visual Designer with visual studio 2013. If it really can not view in designer, please post your issue on connect. If it can, all I can suggest is that you try to identify the relevant source code and differentiate between the 2010 and 2013 versions. Once you know what the problem is, a fix may be apparent.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.




    • Edited by Anna Cc Thursday, October 31, 2013 7:14 AM
    • Proposed as answer by Anna Cc Monday, November 4, 2013 8:32 PM
    • Marked as answer by Anna Cc Tuesday, November 5, 2013 7:29 AM
    Friday, October 25, 2013 10:36 AM