Hello Trimble Community,
Could somebody please explain why my wpf formatting is being messed up at runtime? Left below is the what I expect to see and Right below is what I see after running the wpf.

I tried to override the formatting on OnLoad() which is not the great way but it still does not do what I need.
# Load Event of the WPF Class
def OnLoad(self, cmd, buttons, event):
self.mypannel.Width=1000
self.mypannel.Height=400
and here is the stack panel that I'm dealing with. BTW, is there anyway to bring in Grid or Canvas or Is it possible to have access the window element like standard wpf? Any help will be appreciated!
<StackPanel x:Name="mypannel" Background="BlueViolet" Width="700" Height="283"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:Wpf="clr-namespace:Trimble.Vce.UI.Controls.Wpf;assembly=Trimble.Vce.UI.Controls" mc:Ignorable="d" HorizontalAlignment="Stretch" Margin="4" >
<TextBlock Text="Select the Utility Network:" FontSize="13" FontWeight="Bold" Margin="5 0 0 2"/>
<Wpf:ComboBoxEntityPicker x:Name="utilitynetworkslist" VerticalAlignment="Center" VerticalContentAlignment="Center"/>
<Button x:Name="BrowsetoXML" Content="Browse to Source XML" Click="BrowsetoXML_Click"/>
<TextBlock x:Name="Tb2" Text="Total Number of the Element:"/>
<TextBlock Text="Nodes:" Margin="0,4"/>
<ListBox x:Name="LB1" VerticalAlignment="Center" VerticalContentAlignment="Center" Background="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}" Height="158"/>
</StackPanel>
------------------------------
Morteza Kiani
------------------------------