Problems with the sizing in NodeTemplate


I wanted to add Form in a Node and it’s successfull but I have a problem with the initial size of my nodes. I prefer that my node have the best size as in decisiontree sample but I have this :

I tested the argument “Auto” in Heigth ou Width but there are no effect

help me please

this my template :

                <Path x:Name="Icon"
                    go:NodePanel.Figure="{Binding Path=Data.Figure}"
                    Stroke="{Binding Path=Data.Highlight, Converter={StaticResource theStrokeChooser}}"
                    go:NodePanel.Spot1="0 0" go:NodePanel.Spot2="1 1"
                    go:Node.LinkableFrom="True" go:Node.LinkableTo="True" Cursor="Hand"/>
                <Border BorderThickness="1" BorderBrush="Black" >
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                <Grid Grid.Row="0">
                    <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center"
                        Text="{Binding Path=Data.Title}" FontWeight="Bold"  go:Part.TextEditable="True"
                        Foreground="{Binding Path=Data.Color, Converter={StaticResource theStringBrushConverter}}"/>
                <grid:DataGrid Grid.Row="1" AutoGenerateColumns="False" CanUserResizeColumns="False"
                     Background="White" HorizontalAlignment="Center" VerticalAlignment="Center"
                     ItemsSource="{Binding Path=Data.Items}" HeadersVisibility="None" BorderBrush="White">

                                        <Path go:NodePanel.Figure="{Binding Path=Figure}"
                                            Width="10" Height="10"
                                            Fill="{Binding Path=Color}"
                                            Stroke="Black" StrokeThickness="1"/>
                        <grid:DataGridTextColumn Binding="{Binding Path=Name}"/>

                    <TextBlock Text="{Binding Path=Data.Key}"
                 Visibility="{Binding Path=Data.Key.Length,
                              Converter={StaticResource theCountVisibilityConverter}}" />

By default the value of NodePanel.Sizing is “Fixed”, which means that the main element’s size is not changed, but everything else is fit inside the main element (a Path in this case). But because you didn’t specify a Width and a Height for the Path, it defaulted to 100x100.

But you want to set NodePanel.Sizing=“Auto”. This will cause the main element to be automatically resized to fit around the other element(s). And of course you should not be setting the Width or Height on that Path.