-
-
Notifications
You must be signed in to change notification settings - Fork 408
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
Effects adorner offscreen and hiding inappropriate drag adorner #325
Comments
I can partially solve the third problem by moving the
(Also need to change You can see this change at https://github.com/uecasm/gong-test-1/tree/textblock-header. This fixes the problem of the wrong Drag adorner being displayed while dragging an item from group 2's listbox around inside that listbox. However it still displays that adorner when dragging an item from group 2's list over the group 2 tab header, which I don't want. (The effect adorner appears to be smart enough to hide itself for that case.) |
Part one is fixed and available with v2.0.6
A pre-compiled showcase app is available on every release https://github.com/punker76/gong-wpf-dragdrop/releases |
Configurable effects adorner would be amazing! I think have the same use case - I want to provide a short explanation tooltip about why a drag-drop operation is invalid (due to constraints placed on which items can be copied to other lists). I can achieve this with the default effect data template, because I can supply the contextual information from the ViewModel in the form of effect text and destination text. However there's no way to configure the look and feel to match my app. The only alternatives are to supply a custom drop target adorner to render a tooltip, (which almost works, except the adorner is clipped at the boundaries of the element I'm dragging to), or else to use an EffectAdornerTemplate (in which case I can't dynamically set the text). I'd be happy to do the work and create a P/R, but I have no idea where to start. Any suggestions? |
So I've had a look over the past few days, and after learning a bunch of stuff about WPF which I haven't needed to know until now, I have a solution of sorts. I'm not sure if it's good practice or not though, it certainly seems a bit hacky to me. What I did:
My adorner resource then looks like this: I'd be happy to create a pull request, but since 'Tag' in Path=Tag.EffectText is not resolvable at compile time, I think this is probably not a great solution for a library like this. Thoughts? |
What steps will reproduce this issue?
The first problem is that the Effect adorner gets clipped at the window edges; this appears to have been previously solved for the Drag adorner (Drag Adorner Gets Clipped #69), so perhaps that existing solution just needs to be applied to both?
The second problem is a more general one that the Effect adorner doesn't appear to be template-customisable based on the drop target (other than supplying
EffectText
andDestinationText
, which in turn can't be used in a purely XAML template). This might be a "too hard basket" issue to actually solve for now, but bears mentioning.The third problem is that (after switching to use the Drag adorner instead of the Effect adorner due to the above two problems), the Drag adorner ends up being displayed inappropriately in the case when dragging items inside the second tab.
Expected outcome
More explanation of the intended and observed behaviour can be found in the readme in the repository below.
It's possible that some of this is already solvable using existing features of the library, but there really isn't much documentation for it, and even reading the code it can be hard to understand what some properties are for. (It would also be nice if you provided a pre-compiled Release of the Showcase app, so that people don't have to install additional tools to compile it themselves.)
Repo
https://github.com/uecasm/gong-test-1
Environment
The text was updated successfully, but these errors were encountered: