Highlighting dragged-over node

Thanks. I am wondering how you can highlight the node (the static org chart node) when you dragg a node from the palette over it. What event do I intercept or class to override?

As you can see, the Org Chart Editor sample supports these mechansims whereby the part’s Part.IsDropOntoAccepted property is temporarily set to true when the user is dragging over the part. So the highlighting can be done in XAML.

You also need to customize the Diagram.DraggingTool to support this drop-over behavior, by setting DraggingTool.DropOntoEnabled=“True”.

Thanks for the reply. I am wondering how I know which node in the tree view (on the right hand side) the dragged part/node is hovered over when user is dragging. In terms of highlighting the node in the tree, I tried all what you said, but the magic is not happening yet. I am still trying.

Look at how the NodeTemplate in the Org Chart Editor sample data-binds the Border’s Background:

<go:BooleanBrushConverter x:Key="theBooleanBrushConverter"
                          FalseBrush="White" TrueBrush="Red" />

<DataTemplate x:Key="NodeTemplate">
  <Border . . .
          Background="{Binding Path=Part.IsDropOntoAccepted,
                               Converter={StaticResource theBooleanBrushConverter}}" >
     . . .

Thanks for your reply. I had those in my NodeTemplate. It must be because of something else. My palette model is a TreeModel too so both of them are TreeModel at this point. I am not sure whether that is the problem. I am going to try using another type of model in the palette and see whether that fixed the problem.

Here is another question. When I drag a node from the palette and hover it over a node in the TreeView, I would like to make the Node on the Org Chart (right hand side) the target node and have an option for the user to make the dragged node become the child node of the target node. Is there a way to do that with GoXam? I would think that there is something in the node template that allows me to do so.
So far I am very impressed with GoXam and I think it is a powerful tool. Thanks for all your support.

I’ve moved these posts into a separate topic, since we’re no longer talking about link validation with drop-onto behavior. It seems that you can’t get anything working.

Could you try modifying the Org Chart Editor sample? Add a Palette using the same model and node data type as the main editor Diagram. Also add AllowDrop=“True” to the target Diagram. If you can get this to work, then you’ll know that you can be successful.

Regarding your other question: sure, you can customize what happens. But I don’t understand what choices there are. And how is the application supposed to display the choices, and when does it do so? And how is the user supposed to express his choice?

Anyway, chances are that you can do what you want by overriding methods on DraggingTool.

It is working. I just have to clean up some of the uncessary code there.