-
-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] Drag&Drop from Toolbox #81
Comments
Hi! It should be pretty straight forward to implement using the DragDrop API provided by WPF. The only issue I see is that the internal class CustomEditor : NodifyEditor
{
/// <summary>
/// Translates the event location to graph space coordinates (relative to the <see cref="ItemsHost" />).
/// </summary>
/// <param name="args">The drag event.</param>
/// <returns>A location inside the graph</returns>
public Point GetLocationInsideEditor(DragEventArgs args)
=> args.GetPosition(ItemsHost);
} Depending on your requirements, you can also show a preview of the node you drag using the I'll create a simple example and link it to this issue. Do you have any progress on this, any specific questions? |
Thank you very much for your quick response and for the PR. I looked into it and I think I understand it and can adapt it to my case. I will also try to use the P.S.: Yes, I use the NuGet package and have no direct access to the source code. This was the reason for my question. |
Hi, thanks for the kind words and for the update. It's really cool that you also implemented the drag over preview. 🙂 |
Hi @miroiu, I love your library and use it in my work. I have some trouble with this drag-and-drop function.So I cannot change the name of the OnDragNode method. If it is, isn't it better to note somewhere that it is enforced by code and you cannot change that name, which could lead to an error if tried? |
Hi, the code does not enforce the names of the |
Yes, it turns out that maybe I created a user component and tried to host it in the form of a winforms application which may be the reason for this issue. Sorry for creating new issue. |
Hi, first of all thank you for this amazing node editor and all your work :)
I recently started to reimplement an existing XNA based node editor in WPF using nodify. However, we currently have a toolbox with applicable nodes in it and can drag&drop those nodes to the editor. I wonder how to realize such a drag&drop action of nodes with nodify. Is it possible and if yes how?
The text was updated successfully, but these errors were encountered: