Node resize issue

we have two sample application in both I am using the same configuration for diagram along with node template. But we observed some differences while resizing the node, In first application resizing is working fine while as in Application 2 shape is getting cut. Please find below image to get the exact feel what is happening.

Actual Node

Below Behavior : After resizing the node

Application 1 (Working as expected)

Application 2 (Not working as expected)

What could be the possible scenario which may lead to this malfunction ?
I’ve checked both templates and below points, Are same.
No max size is defined in both templates

So both templates are identical to each other? That seems hard to believe. What are the templates?

Yes, Both are identical.

 <DataTemplate x:Key="{x:Static prop:Resources.Template}">
        <StackPanel Tag="Template" MinHeight="30" MinWidth="35"
              go:Node.LocationSpot="Center" ToolTip="{Binding Path=Data.Key}"
              go:Part.LayerName="{Binding Path=Part.IsSelected, Converter={StaticResource selectedLayerConverter}}"  
              HorizontalAlignment="Center" VerticalAlignment="Center">

            <Grid Name="ItemData" Height="30" Width="35" MinHeight="30" MinWidth="35">
                    <ColumnDefinition Width="5"/>
                    <ColumnDefinition Width="*"/>

                    <RowDefinition Height="*"/>

                <Rectangle Grid.Column="1" Grid.ColumnSpan="3" Stretch="Fill" Grid.RowSpan="3" Stroke="Black" StrokeThickness="0.5" Fill="White"/>
                <!--Left port-->
                <local:CustomPort x:Name="InPort2" go:Node.LinkableMaximum="1" go:Node.PortId="{x:Static prop:Resources.InPortName1}"  Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" go:Node.LinkableFrom="False" go:Node.LinkableTo="True" />

The StackPanel seems superfluous, since it has only one element in it.

I think you want to set go:Part.ResizeElementName=“ItemData”.

Yeah, I’ve checked resizing after setting go:Part.ResizeElementName=“ItemData” but its, still not working.
StackPanel - multiple items will come thats why we took stackpanel.

If the templates are the same, then maybe the data is different. But I cannot guess why.

Which Data would you like to refer here ? although there is no data which we are setting, isn’t it should be the template only which decides the UI layout.

let’s see some more details about the issue. we’ve created a User-control(Wrapper assembly) using GoWpf. Now we are using this assembly in two separate windows of an application. on first window we’ve WPF as base. where everything is working fine. Now, on the second window of the same application. we are using Windows forms as base, in this we’ve used Element Host to host the same user-control. where this issue is coming up.

I was wondering about the bound data being different, but that was just guessing, since the problem’s cause is not apparent to me.

I’m very surprised that being hosted in a WinForms application would matter for this case. But I cannot rule it out at this time.

Actually it’s an combination of legacy and new technology base in the same application so we also can’t change the underlying things and we are close with release deadlines. So, could you suggest some approach which we can take up and resolve this issue. Please let us know if you need anything from our side.

If the templates and the data really are the same in both, I really cannot explain any differences in behavior or appearance.

If I were you I would spend some time with the debugger looking carefully at each of the FrameworkElements in the Node, to see how big they are in all of their sizes and bounds, and to spot a difference between the same corresponding objects.

Once you figure out exactly what is different in the FrameworkElements maybe we can figure out how they are getting that way.

ok, we’ll debug this out for win forms.
Apart from this how we can set height and width of the Node. While resizing we are getting the rendered height from ActualHeight. but while setting should we directly set Node.Height or do we have some other mechanism to set it ?
if we set directly Height and Width in above template from Grid to StackPanel same issue is coming up while resizing the node as seen in above images.

Yes, setting the Width and/or Height is how you control the size of an element. That is what the ResizingTool does.

I still have no explanation for why or how two identical controls would be behaving differently with the same data. Careful debugging is all I can suggest at this time.