Hello everyone,

I have to create a wpf application where i have to create 2 windows(one for toolbox and one for work area) similar to visual studio appearance, in toolbox window i will have controls like button,textblock etc, when i do drag and drop from toolbox to work area on any of these controls, same controls have to be created in work area, just like we can drag and drop buttons from tool box to work area in visual studio.

please help me with the code, i am new to wpf and i have to create this application ASAP.

Hi. Though I haven't done it myself yet, I found a lot of examples online on how to do it. Here are a few links that can get you started. Once you have some code feel free to ask for help if needed.

MSDN Blog
MSDN
Codeproject Example

Hi pitic, thanks for the reply.
but the given links demonstartes the basic drag drop options, like changing tha background color, layouts etc..

Please let me know if you try out the functionality mentioned in the request..

Thanks in advance..
Rohit

A basic version would be to have a list of classes that represent each control. In your toolbox, set a property such as a Type to say what the class it represents is. When you perform your drag drop operation, look at the class it represents, instantiate a new version with some default sizing and center it around your drop point.

That will give you basic drag drop functionality for creating a UI.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.