Comments (5)
I created the PR. Relevant files are (EditorView.xaml, EditorView.xaml.cs, NodifyEditor.cs).
Please let me know if this helps.
from nodify.
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 DragOver
event but this seems to be straightforward. I will update you with the progress.
P.S.: Yes, I use the NuGet package and have no direct access to the source code. This was the reason for my question.
from nodify.
Hi,
as said, here is the update: It works :) I also have implemented the DtagOver
preview and everything with control of the respective viewmodels. Thanks again for this awesome library and your support.
from nodify.
Hi! It should be pretty straight forward to implement using the DragDrop API provided by WPF.
The only issue I see is that the NodifyEditor.MouseLocation
- which could be used to position the dropped node - may stop updating due to MouseMove
events not firing anymore while dragging. To workaround this, create a subclass of NodifyEditor
which exposes a method to get the coordinates inside the editor (graph) space and use it in the drop event handler to position the node (assuming you use the nuget package and don't have access to the source code, otherwise you can add this method to the NodifyEditor itself).
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 DragOver
event.
I'll create a simple example and link it to this issue. Do you have any progress on this, any specific questions?
from nodify.
Hi, thanks for the kind words and for the update. It's really cool that you also implemented the drag over preview. 🙂
from nodify.
Related Issues (20)
- [Feature] Copy/Paste and Undo/Redo editor actions HOT 2
- [Question]How to change the border color of Node HOT 5
- [Bug] Changing BorderThickness will cause an exception to be displayed when nodes are selected HOT 6
- [Question] Connection Behind Grouping Nodes HOT 1
- [Question] Sorting the graph HOT 3
- I want to hide Pending Connection content until it's hover to invalid connection, How can I? HOT 6
- [Bug]Triggered Background of connectors bindings HOT 1
- How can I use strings as input / output types on nodes?[Question] HOT 1
- [Question]Can display text on the connection? HOT 2
- [Question] Problem about Revit-Nodify-Cooperation-Experiment HOT 2
- [Question] How do you change the theme during runtime? HOT 2
- [Application] Avalonia refactoring version HOT 4
- [Question] Draggable arrowheads, is it possible? HOT 2
- [Feature] Fit selected nodes into view HOT 1
- [Bug] set FlowDirection property of Node, the connection of this Node will not update HOT 4
- [Question] How to make the line above the node HOT 1
- [Question] Is there a setting for auto layout? HOT 1
- [Docs] Dead links in contributing doc HOT 1
- [Question] Most Nodify way to have additional vertical connection flow? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nodify.