Silverlight 4 Drag and Drop Alternatives - silverlight

I want to add the ability to drag a user control from one part of a Silverlight 4 page onto another user control on the same page (not talking about the new Silverlight 4 ability to drag a file from the OS onto the page).
What approach is most straightforward? What approach offers the most flexibility?
Here are some alternatives I found so far
SO drag-and-drop-control-for-silverlight. Same question but answers apply to SL 2.
Alex van Beek's DragManager. Written for SL3.
Silverlight Drag Drop. Also written for SL3.

I can't compare all of the options you've listed but if I wanted to implement control to control drag drop feature I would the DragDrop and the DragDropTarget classes from the Silveright Toolkit. Its the only DragDrop framework I know of that has been refreshed for SL4 and if you already use elements from the Toolkit then that would be a natural solution.

Related

wpf using a windows form

I have a windows form that handles drag and drop of images just fine.Because I cannot find a way to do this in WPF can I add the form to a page and will the drag and drop still work? The images being dragged are from outside of app.
Thanks, Betsy
You can use a WindowsFormsHost in WPF to host Windows Forms controls. This will meet your requirements. Otherwise, take a look at Drag & Drop in WPF. This is fairly easy to implement.

Homemade controls in WP7 Silverlight?

In Windows Phone 7 Silverlight, is there a way to design a custom control from scratch - i. e. with custom drawing and custom touch processing? What do I subclass for that?
Yes you can. You usually subclass Control, ItemsControl, or ContentControl. Here is a blog post that explains the process in detail: Creating a WP7 Custom Control in 7 Steps
As mentioned, you can create a custom control from scratch by deriving from the Control class. To implement gesture handling you can use the GestureService from the Silverlight Toolkit for WIndows Phone 7 or you can directly handle the ManipulationStarted, ManipulationDelta, and ManipulationCompleted UIElement events.
Jeff Prosise has a great series of four posts that cover touch manipulation in great detail:
Part 1
Part 2
Part 3
Part 4
For the "custom drawing" part, what did you have in mind? If a control built up from primitives isn't what you had in mind, what about lines and shapes?

How to implement a Silverlight Control for time table(scheduler)

My company is going to development drag and drop feature in Silverlight. We are very new to Silverlight and just learnt SL for a week ago. But I believe the feature that my company wants can be done in Silverlight. The control about is about the time table in which the resource will be shifted around.
Here is the feature detail. We have one list box on left (resource list) and one table on the right. What we want to do is drag an item from the list onto the table then may have some data manipulation on table. I think it’s simple and but for me I don’t know how to create the table which is I think there is no built in control like this. Please take a look my screenshot below.
http://i.stack.imgur.com/QCaVX.jpg
My questions are:
How can we approach to achieve this
feature?
What is the best way to implement
this control?
How we can handle the event such as
drop, reload, bind and so on?
How can we select and drag cell on
table?
Yes, Silverlight can do that. It has drag-drop and rich support for creating custom user controls.
The Telerik RadControls for Silverlight have a control that does some of what you need. They also make source available.
You might want to research all the available third party controls first to save development cost.
There are too many questions in your question to answer. Best do your research and then ask specific questions.
The Telerik control is called RadScheduleView and can be seen here: http://demos.telerik.com/silverlight/#ScheduleView/FirstLook. It has nice performance and a lot of features.
We are also using Telerik RadScheduleView .It is simple and lot of demos for you to start.

Silverlight Toolkit TreeView Drag and Drop

Does any know how to implement drag and drop in the silverlight toolkit's treeview?
I saw the drag and drop manager for silverlight but supposedly you can put containers around the items you want to drag and drop but I wonder how I would do this on another treeviewitem exactly?
Maybe there is a better way or custom way? Thanks!
The Silverlight Toolkit October (09) release (http://silverlight.codeplex.com/) has added support for drag and drop.
There is a great walk though of the new feature here: http://themechanicalbride.blogspot.com/2009/08/new-with-silverlight-toolkit-drag-and.html
One method that should work is using Telerik controls.
First download the telerik controls then add a reference to Telerik.Windows.Controls; that will allow you to use the IsDragnDropEnable property for the source treeview and the .AllowDrop for the Targeted TreeView

Creating a winforms app that allows drag and dropping of custom 'widgets'

I want to create a winforms application, this application will be similiar to the vs.net winforms designer (in certain aspects).
Basically it is going to be a blank page, where the user can drag and drop a bunch of 'widget's onto the screen. The widgets are basically custom images that I will create, that the user can resize, and it has some text on it by default which the user can double click on it to change the text.
Is this doable in winforms? If yes, what are the key aspects that I have to learn?
This is pretty easy to do in WinForms. Check out basic drag and drop. It's targeted toward 2.0. You'll use the DoDragDrop() method and capture data in drag and drop events. It requires some verbosity, but it gets the job done.
If you're keen on using WPF, take a look at MSDN's topic.

Resources