Drag & Drop

Oystein Bjorke 6 lat temu 0
This discussion was imported from CodePlex

wolf9s wrote at 2014-06-09 15:55:

First, the compoment is amazing!!!!!
Thank you for your effort.

I have some questions:
  1. I want to implement Drag & Drop operations. But I have no idea.
    I want to Drag LineSeries(by drag the legend) from a PlotView to anthoer, and then the original PlotView was closed.
    should I operate PlotCommands and PlotController?
  2. If I want to add close button in the Yaxis(when a plotview has many LineSerieses), how should I do ?
  3. If many LineSerieses in a plotview, how track the point?
Image Axis with close button.

Image Multi tracker (show always)

Image fake legendImage
Everyone, I need your help!

Best Regards!

objo wrote at 2014-06-11 12:17:

  1. WPF? I think this must be done using the drag/drop features in WPF, I don't think the PlotController can help you here.
  2. Buttons must be in an overlay, they are not supported in the plot model. See Source\Examples\WPF\WpfExamples\Examples\OverlayDemo
  3. The tracker should work with many LineSeries. The PlotModel has a HitTest method you can use to do hit testing.

wolf9s wrote at 2014-06-15 16:40:

Thank you for your response!!

For Drag & Drop , I user a Rectangle and a TextBlock ( in an overlay) instead of the real Legend. But I can't confirm the position of the fake legend.(The distance between PlotView's Left and the PlotArea's Left, it should be the width of the Y Axes, but I cant't get it).
My idea is wrong?

I try change the left of the fake legned in PlotView's Loaded event and PlotModel's Updated event .But I always get the 0.

But I debug and find in RenderBox (in PlotModel.Rendering.cs file) method,the PlotArea's value is not 0.

wolf9s wrote at 2014-07-01 03:30:

Help me, please!

objo wrote at 2014-07-02 12:47:

Sorry, I don't understand the problem here. Can anyone help?

wolf9s wrote at 2014-07-23 18:08:

I don't know why the image can't display! but you can click the link to look at it.
Can These images help understand my ideas?

Slxe wrote at 2014-07-24 15:18:

Using imgur.com instead of SkyDrive might help, but anyway this sounds like something that is out of scope for OxyPlot to provide, as drag and drop functionality is on the Frame level if I recall correctly.

Just as an idea you could try serializing the Series you click on and saving it outside of the PlotView, and removing it from the PlotModel. Have some kind of fancy draging image on the cursor then when the mouse button is released have the program check for a PlotView where the mouse cursor is, deserialize the Series and add it to this PlotView (I may be over thinking the serialization though, probably could just be an object).

I haven't played with drag and drop functionality since I was working on UIs in Python and Qt, so it's been a while, but hopefully this helps.