Skip to content
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

[New Feature] Drop target hints #487

Closed
bsundsbo opened this issue Mar 15, 2024 · 3 comments
Closed

[New Feature] Drop target hints #487

bsundsbo opened this issue Mar 15, 2024 · 3 comments
Milestone

Comments

@bsundsbo
Copy link
Contributor

I'm looking for a new feature with Hints for drop targets that can accept data of a particular type, and give the user information about what will happen when something is dropped (we've discussed this by email in the past). We've had this functionality in our apps for over a decade, and want this functionality as part of the gong-wpf-dragdrop project.

The functionality is similar to dragging a file to the text field of the message input part in Teams, "drop file her" to upload in dropbox or other websites.

Here is a sample I added to a fork years ago, though some improvements could obviously be made.

DropHints

@bsundsbo bsundsbo added the Bug label Mar 15, 2024
@bsundsbo
Copy link
Contributor Author

I've started working on a new PR for this where I write from scratch, and not directly reusing the code from the example above. However, there were some limitations to time and availability of being able to construct DropInfo at the time.

I will be making some adjustments to the screenshot above though, with DestinationText and datatemplate for how to display this text to the user.

In my PR I am making an interface IDropTargetHint which I might derive from IDropTarget, and implement in the DefaultDropHandler so everything works out of the box assuming the default handler is used, however, I am running into a question about what to pass to that method.

What I am initially wanting my IDropTargetHint.DropHint to do is:

  • Assign the adorner
  • Assign DestinationText
  • And other potential things

The issue that I am trying to figure out, is I should extend IDropInfo with DropTargetHintAdnorner for the user to assign, and then go from there, or should there be a IDropHintInfo with limited parameters? Using DropInfo gives the flexibility of being able to reuse the DefaultDropHandler.CanAcceptData and reusing other methods and classes (but DragEventArgs won't be available), but it also gives the potential of a lot of properties that are not needed.

What are your recommendations?

@mangoyoga80
Copy link

Addressed in PR #489

@bsundsbo
Copy link
Contributor Author

bsundsbo commented Sep 5, 2024

Addressed in PR #489

@punker76 this PR is also of interest

@punker76 punker76 added this to the 4.0.0 milestone Sep 10, 2024
@punker76 punker76 closed this as completed Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants