1.2.2.4 - GoWPF - CenteredNodeData

Hi,

Assume you have a diagram view that can be realized in a diagram without the use of a horizontal scroll bar.

Then select a Node. If this operation repositions (shifts) the view in a manner where some of the nodes are now out of the diagram viewport, no horizontal scroll bar is displayed.

In another example. Assume you have a diagram view that can be realized in a diagram with the use of a horizontal scroll bar.

Then select a Node. This operation will shift the view, but it doesn’t appear that the horizontal scrollbar is behaving properly. (click the line down or line up repeat button will cause the view to “jump”)

I have also noticed that sometimes it will not complete the “center” operation, it starts to scroll it to view, and then will stop.

I think i remember reading somewhere that you are still working out some issues with this property, but i figured I would post my findings just in case.

I don’t know of any problems.

Is the result any different if you set myDiagram.Panel.ZoomTime to zero?

What values are you using for the HorizontalContentAlignment, VerticalContentAlignment, and any other related properties?

setting myDiagram.Panel.ZoomTime to zero seems to fix the center operation. At least, in the 5 minutes of testing, it would always center the newly selected node.

I haven’t modified HorizontalContentAlignment, VerticalContentAlignment values from their default, but here they are :

(from snoop)

Northwoods.GoXam.Diagram.HorizontalContentAlignment = left
Northwoods.GoXam.Diagram.VerticalContentAlignment = top

Northwoods.GoXam.Diagram.HorizontalAlignment = stretch
Northwoods.GoXam.Diagram.VerticalAlignment = stretch


<go:Diagram
CenteredNodeData="{Binding ElementName=godiagram, Path=SelectedPart.Data}"
NodesSource="{Binding Root}"
LinksSource="{Binding Link}"
x:Name=“godiagram”
AllowDrop=“true”
DraggingTool="{Binding DraggingTool}"
PartManager="{Binding PartManager}"
SelectedPart="{Binding SelectedPart, Mode=TwoWay}"
Model="{Binding GoXamModel}"
GroupTemplate="{DynamicResource GoDiagramAssignmentGroupTemplate}"
NodeTemplate="{DynamicResource GoDiagramNodeDataTemplate}"
LinkTemplate="{DynamicResource LinkTemplate}"
Background="#FFE0E0E0">

            <go:Diagram.Layout>
                <go:TreeLayout  
                    Sorting="Ascending"
                    Alignment="CenterChildren" 
                    Arrangement="Horizontal" 
                    Angle="90" 
                    Conditions="All"/>
            </go:Diagram.Layout>

        </go:Diagram>

Are you doing anything else besides setting Diagram.CenteredNodeData?

We can investigate the issue.

I'm not sure what you mean by anything else, but in my view model constructor i have some additional things set :
[code]
...
Root = new ObservableCollection();
// GoXam
Link = new ObservableCollection();
PartManager = new GoXamCustomPartManager();
GoXamModel = new GraphLinksModel();
GoXamModel.NodeKeyPath = "SalID";
GoXamModel.LinkFromPath = "FromString";
GoXamModel.LinkToPath = "ToString";
GoXamModel.NodeIsGroupPath = "IsSubGraph";
GoXamModel.GroupNodePath = "SubGraphKey";
GoXamModel.Modifiable = true;
DraggingTool = new GoXamCustomDraggingTool(Index);
DraggingTool.DropOntoEnabled = true;
...
[/code]
And here are the Templates :
[code]






<go:LinkShape x:Name="Path"
go:LinkPanel.IsLinkShape="True"
Stroke="#FF425370" StrokeThickness="3" />
<Polygon Fill="Black" Points=""
go:LinkPanel.Alignment="1 0.5" go:LinkPanel.Index="-1"
go:LinkPanel.Orientation="Along" />



<Border
Background="Transparent"
go:Node.SelectionAdorned="True">











<TextBlock
HorizontalAlignment="Left"
VerticalAlignment="Top"
Text="{Binding Data.ToolTip}"
TextWrapping="Wrap"/>






<ProgressBar
ap:TimerStateAttachedProperty.TimerState="{Binding Data.Data.CommandTimer.State}"
Height="16"
Maximum="{Binding Data.Data.CommandTimer.Time, Mode=OneWay}"
Minimum="0"
Style="{DynamicResource CircularProgressBar}"
Value="{Binding Data.Data.CommandTimer.TimeRemaining, Mode=OneWay}"
Visibility="{Binding Data.Data.CommandTimer, Converter={StaticResource myStiCmdTimerToVisibleConverter}}"/>








<Grid
go:Part.SelectionAdorned="True"
go:Node.LocationElementName="grid"
go:Node.SelectionElementName="grid"
go:Part.DropOntoBehavior="AddsToGroup" >

<go:GridLayout
Comparer="{StaticResource TheNodeComparer}"
Sorting="Ascending"
Alignment="Position"
Conditions="All"
WrappingWidth="0"
WrappingColumn="1"
CellSize="0,0"
Spacing="5,5"/>
<Border
Grid.Row="0"
Background="#FF1D4391"
BorderBrush="{Binding Path=Node.IsDropOntoAccepted, Converter={StaticResource theBrushChooser}}"
BorderThickness="1"
Margin="0" >

<TextBlock
Text="{Binding Data.DescriptionExtended}"
Background="#FF425370"
Foreground="White"
TextAlignment="Center" />
<go:GroupPanel
x:Name="grid"
SurroundsMembersAfterDrop="True" />



[/code]