locked
VS integration of an UI API RRS feed

  • Question

  • Hello,

    I'm working with the UI API of an application and it's a real pain. I am thinking of trying an integration with the VS designer but, unfortunately, I have no experience with VS extensibility and I don't even know if what I want is possible. Let me lay it out for you:

    The API is poorly designed; there is basically no inheritance between controls and creation/destruction might differ from one control to another. On top of that, adding controls via the API itself is kind of slow, so they wrote an UI designer that exports the forms in XML which you can later load with a single call. As you might have guessed, the designer is s**t.

    Also, the event handling is not too bright either: there is a callback for each event type which handles events for the entire application, which you must filter manually (ie IFs and SWITCHs).

    What I would like to do is write a designer similar to the standard .NET UI designer, with the specific controls of the mentioned API, which would write both in an XML file (window properties, items and other information) as well as in a source files (for event handling).

    Note that I do not want any complex behavior in design mode. What are my options?

    Thank you.

    Tuesday, September 21, 2010 11:52 AM

Answers

  • Hi Rimio,

    It sounds like what you want to do, is implement a custom designer, but I'm unclear as to whether you want this designer to reside in the VS IDE.

    The WinForm designer is actually rehostable outside the VS IDE, but the XAML/WPF designer is not. Integration with the XAML/WPF designer is not trivial, and the only example we have of this to date, is the IronPythonIntegration samples available up on codeplex.

    While you can probably do what you are describing with the winform designer, The XAML/WPF designer was not designed with the same extensibility features, so using it as a basis for a custom designer/editor isn't very feasible.

    To host the winform designer in a stand-alone app, you might want to have a look at the following:

       INFO: Code Sample That Demonstrates How to Create a Custom Form Designer by using Visual C# .NET
       Hosting Windows Forms Designer (developerFusion article)

    Sincerely,


    Ed Dore
    Wednesday, October 20, 2010 5:31 PM