Palette not showing every node

I made a dll in which there is a Palette with 3 Node in it (all based on the Flowgrammer demo).
The first node in showin a NodeShape with go:NodePanle.Figure=“BpmnEventTimer”, the second and thrid are self drawn (on showing a Rectangle with a path in it and the other one a Control out of another Assembly).
Now the Problem, I wrote two demos using the dll and one final Application.
In the Demos the Palette ist showing all three Node, but in the Application the first Node with the Timersymbol is missing. There is and empty space where the timer should be and if I analyse with snoop I can find the correct Node, but it is not showing.

Any Idea?

In your Application is that whole Node completely unseen, or is the Node there but only the Shape/figure is not shown?

The Node is completely unseen. There is absolutly nothing.

I inserted a screenshoot where snoop is showing the timer node in the visual tree. I have no idea why it is not visible.

And there are no errors or warnings in the Output window/log?

In the debugger, is the Visible property false for that Node?

The Visible property has the value “Visible” and I can see no errors in the outputwindow.

Is there a restriction in the unlicensed version of GoWpf?

I compared the Properties in the working Demo with the Properties in the Application and found a difference:

The “IsArrangeValid” property in the Demo is True while the same property in the not working Application is False.

Is this a hint to the problem?

I have another hint! It is always the first node.

I’ve changed Node1 and Node2 and now the Timer is visible but my ownerdraw symbol not.
It’s the same - IsArrangeValid is false.

Can I force a Rearrange of a specific Node to make IsArrangeValid come true?
Daigram.UpdateLayout() does’nt work.

That is very odd. I do not recall seeing or hearing about any problem like that.

I suppose you could call Diagram.LayoutDiagram(), but that ought not to matter.

Diagram.LayoutDiagram() is not working.

I temporary helped me with a “Nothing”-Node that I insert a first place.

        toolPaletteModel.NodesSource = new List<ToolNodeData>
        {
            new ToolNodeData {Key = "None", Text = "", Category = "None"},  // <-- 
            new ToolNodeData {Key = "Time", Text = "Time", Category = "Time"},
            new ToolNodeData {Key = "Signal", Text = "LogicSignal", Category = "Signal"},
            new ToolNodeData {Key = "Salvo", Text = "Salvo", Category = "Event"}
        };
        ToolPalette.Model = toolPaletteModel;


        <DataTemplate x:Key="None">
            <go:SpotPanel Style="{StaticResource SpotPanelStyle}">
                <go:NodePanel Sizing="Fixed" go:SpotPanel.Main="True">
                    <Rectangle Width="0" Height="0" />
                </go:NodePanel>
            </go:SpotPanel>
        </DataTemplate>

        <DataTemplate x:Key="Time">
            <go:SpotPanel Style="{StaticResource SpotPanelStyle}"
                          go:Node.Location="{Binding Path=Data.Location, Mode=TwoWay}" ToolTip="{Binding Path=Data.ItemHint}">
                <go:NodePanel Sizing="Fixed" go:SpotPanel.Main="true">
                    <go:NodeShape go:NodePanel.Figure="BpmnEventTimer"
                                  Stroke="{Binding Path=Data.Highlight, Converter={StaticResource StrokeColorConverter}}"
                                  StrokeThickness="{Binding Path=Data.Highlight, Converter={StaticResource StrokeThicknessConverter}}"
                                  Fill="Aqua"
                                  Height="48" Width="48"
                                  Opacity="{Binding Path=Data.Opacity}" />
                    <TextBlock Style="{StaticResource TextBlockStyle}"
                               Text="{Binding Path=Data.Text, Mode=TwoWay}" />
                </go:NodePanel>
            </go:SpotPanel>
        </DataTemplate>

This is working in both Demos and in the final Application, but it’s sure just a workaround!

I bought the source code for GoWpf. Do you have any idea where to look at and how to debug?

Thanks for sharing the DataTemplate.

In the debugger, what is the Node.Location of the unseen first node?
Are there any error or warning messages?

It’s very odd that that first Node has IsArrangeValid false.
Is there any asynchronous modification of the model?

It’s all based on the Flowgrammer Democode.
There is no asyncronous modification. What’s really wierd is that the same control from the same directory is working in the other apps.

Here is the xaml for the ToolPalette:

<go:Palette x:Name="ToolPalette" 
     Padding="5" 
     Margin="2" 
     MaximumSelectionCount="1" 
     NodeTemplateDictionary="{StaticResource NodeTemplateDictionary}"
     HorizontalContentAlignment="Center">
   <go:Palette.Layout> 
     <go:GridLayout Sorting="Forward" 
                    Alignment="Location" 
                    CellSize="5 5" 
                    Spacing="5 5" 
                    WrappingColumn="1" /> 
   </go:Palette.Layout> 
</go:Palette> 

The Location of the unseen node is n. def.; n. def. (it’s a german environment, nut I think it’s calledthe same in english).

But as you can see on the screens it’s the same for every node - also the visibles.

I assume “n.def” means Double.NaN – “Not a Number”.
OK, so it’s not showing because its Node.Location is (NaN, NaN). But I don’t understand what has caused it to either never receive a location (which is assigned by the GridLayout) or to lose it (which might be related to IsArrangeValid being false).

For debugging, I suppose you could set a breakpoint in a Diagram.InitialLayoutCompleted event handler on your Palette. Then you can check the values of Node.Location for that (and all Nodes) in the Palette.

In the Flowgrammer-Demo the Location of nodes in the Palette is also n.def; n.def as you can see in the screenshoot.

You missed that the visible Nodes have a Location of n.def; n.def also.

I guess it has nothing to do with the location property - or the debugger shows wrong values.

Really? When I debug the unmodified Flowgrammer sample, the “If” node in the Palette has a Location of: + Location {16.95,25.96} System.Windows.Point
And the “Action 1” node has a Location of: + Location {16.95,25.96} System.Windows.Point
(And of course both nodes have their UIElement.IsArrangeValid property true.)

Is there any way you can help me reproduce this problem?

Do you have any code that touches your Palette after initializing its Model?

I tried it on another Computer and it’s the same. Location is unset.
What Visualdebugger are you using?

Did you look at the Location-Property of the Node or of the SpotPanel?

My SpotPanel has values in location (-24,-24,48,48).

The go:Node.Location attached dependency property is only used on the main visual element of the Node. In this case it would be attached to the SpotPanel.

But the Node class also has a Location CLR property whose implementation just delegates to that attached property on the Part.VisualElement.

Location is of type Point, so it would not make sense for it to have four numbers.

Sorry, my fault!
The Location in the SpotPanel is 0;0 {Path=Data.Location}

That sounds like a reasonable expected location for the first node, so we know that the layout is working correctly.

So I am still mystified why IsArrangeValid is false in your app but not in your demo. Something is changing that first node without the diagram arranging that node again. Is there anything that you are willing to do to help me debug this? Or do you want to live with your work-around?