SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Adding a control programatically in XamlDesigner

Last post 03-21-2011 11:22 AM by DanielGrunwald. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-18-2011 2:43 PM

    Adding a control programatically in XamlDesigner

    I need to add a control programatically in to the design surface (designpanel). Is there a way to do this?!?

    I tried setting the current tool of the design context as createcompoenttool with the expected type, but it requires a mouse down event to add it to the design panel. Is there a better way to do this programatically.   

    Thanks,  

    Sudarsan Srinivasan

  • 03-21-2011 6:59 AM In reply to

    Re: Adding a control programatically in XamlDesigner

    Ok, I guess I have found a solution. I used the PlacementOperation class to add the design item on to the design surface. Is this correct, please reply.

  • 03-21-2011 11:22 AM In reply to

    Re: Adding a control programatically in XamlDesigner

    Yes, that's a possibility if you want to use the designer's placement logic. But if you already know that, e.g. you want to add the new item as a child to a Grid, then you can just add it directly: gridItem.Properties["Children"].CollectionElements.Add(...);

Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.