TaskBoard - Decorators between Cards

Views for WPF Forum

The latest build of this product (v2019.1 build 0685) was released 4 months ago, which was before this thread was created.
Posted 26 days ago by Cristian
Version: 19.1.0685
Avatar

I have a short question - I'm trying to add decorators between cards (some downward facing arrows that show a particular flow direction), sort of like the ones present in the Microsoft Workflow Foundation rehosted designer. I've attached a quick video clip showing this:

https://www.dropbox.com/s/i3z3xr08s038p6o/jQCXyjiCHA.mp4?dl=0

I've managed to create two types of data templates (one for the actual items and one for the separator/decorator items), but I'm having issues with the way they're presenting while I'm still dragging. I was thinking of checking to see if I drag the items over a separator, but the binding list is not updated until after the drag operation is finished:

https://www.dropbox.com/s/3yxkj9vakcj9yzn/doubledDecorators.jpg?dl=0

So, in short, while I'm still dragging, I have not been able to find a way to show/rearrange existing items in visually pleasing manner. 

Is there any way to achieve what I'm looking for? Am I handling this from a wrong perspective? Should I use a different Actipro control for this?

Kind Regards,
Cristian

[Modified 26 days ago]

Comments (4)

Posted 25 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Cristian,

There is a TaskBoard.CardDragOver event that fires as you drag a card over other things.  I wonder if you could adjust the arrows there.  That being said, we haven't tried changing the source collection in that event and it might corrupt the internal drag/drop data.

What if you made the arrow part of the main card template instead and added some boolean onto your view model for whether to show it?  That way it wouldn't be a separate "card".


Actipro Software Support

Posted 25 days ago by Cristian
Avatar

That is actually the problem - I haven't been able to change the source collection "on the fly", using the mentioned events. At least not without raising some unhandled exceptions :)

As a workaround, I've included the arrow marker within the actual card view.

One more question - I'm also trying to drag and drop items to the taskboard from a sort of toolbox. Is there any way to ellegantly integrate it with the existing taskboard events? What should the DataObject contain?

Appart from that, the only way I can achive this would be to override the PreviewDrop event within the taskboard control. However, from the docs, it's not really clear how I can handle identifying between which TaskCards the drop occured (to insert a new card between two existing cards for instance).

Answer - Posted 24 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Cristian,

Unfortunately I don't believe there is any API exposed to programmatically start an external drag.  We aren't using standard drag/drop events for the column/card dragging either, so it isn't possible mimic it.  Your best bet is to have something like double-clicking your toolbox items insert a card and then let the user drag it from there.  Or possibly also support normal Windows drag/drop from the toolbox, figure out which column the dragged toolbox item is over, and insert a card at that location.  Then the user can do our built-in drags from that point on.


Actipro Software Support

Posted 24 days ago by Cristian
Avatar

Yeah, that's exactly what I did. I'm using the column/card hit testing (looking for closest card to the drop location point) - and then inserting into the item source at the specified index.

Thank you for the support!

Add Comment

Please log in to a validated account to post comments.