Hi,
I have a group with items within it, that when dragged (in copy mode) I want it look different than its current look (more clean style, without its sub nodes).
In order to achieve this I’ve prepared a special template for it (a simple border), and I set it here in the PartManager:
public override Northwoods.GoXam.Model.ICopyDictionary CopyParts(IEnumerable coll, Northwoods.GoXam.Model.IDiagramModel destmodel)
<span =“Apple-tab-span” style=“white-space:pre”> {
<span =“Apple-tab-span” style=“white-space:pre”> Northwoods.GoXam.Model.ICopyDictionary retVal = base.CopyParts(coll, destmodel);
<span =“Apple-tab-span” style=“white-space:pre”> foreach (TCanvasItemType canvasItem in retVal.Copies.Nodes)
<span =“Apple-tab-span” style=“white-space:pre”> {
<span =“Apple-tab-span” style=“white-space:pre”> canvasItem.Category = NodeCategories.Dragged;
<span =“Apple-tab-span” style=“white-space:pre”> }
<span =“Apple-tab-span” style=“white-space:pre”> return retVal;
<span =“Apple-tab-span” style=“white-space:pre”> }
I have two problems:
- I can’t manage to get rid of the sub nodes (although the new template doesn’t include any element t hold child nodes).
- The mouse cursor location on the copied node looks like is calculated from the original group template, and not from the new one (I use Node.LocationSpot=“Center”) - it is far left from the dragged node.
Here is the “dragged” node template:
<Border x:Name="_nodeBorder" go:SpotPanel.Main="True" Style="{DynamicResource StandardNodeBorderStyle}"> Converter={x:Static CommonConverters:ImageConverters.BitmapToBitmapSourceConverter}}" Height="16" Width="16" Style="{DynamicResource CollapsableImage}"/> <TextBlock DockPanel.Dock="Left" x:Name="_itemName" Style="{DynamicResource TextBlockStyle}" HorizontalAlignment="Left" Text="{Binding Path=Data.DisplayName}" TextTrimming="CharacterEllipsis" />Thanks in advance,
Or