I am trying to add nodes to my diagram. My View snippet is as follows:
<go:Diagram x:Name=“Diagram”
Model="{Binding Path=Model, Mode=TwoWay}"
NodeTemplate="{StaticResource ResourceKey=NodeTemplate}"
BorderBrush=“Black”
BorderThickness=“1”
DataContext="{Binding DiagramViewModel}"
Margin=“5”
go:Part.Selectable=“True”
SelectedPart="{Binding SelectedPart, Mode=TwoWay}"/>
DiagramViewModel is a property in the main view model. I have a button which adds new nodes.
When that button is clicked, I want to use Diagram.Panel.ComputeBounds method to compute the rectangle of the diagram, add an offset to the rect bounds and use that to set the location of the newly added node. But to do this, I would require Panel property in ViewModel which has a private set.