I have a problem with nested StackPanels. If I define StackPanels like in the code below, button binds to command (MVVM and command pattern) but doesn't react on button click (command function is not called). When I put stackPanel4 on second position (below stackPanel3) everything works ok. When I move stackPanel4 on the last position (I have more StackPanels then two inside parent StackPanel), button is not bound and command function is not called. What could be a reason for this behavior? If I set DataContext for stackPanel4 it works ok.
<StackPanel DataContext="{StaticResource vmUserMasterData}" Grid.Column="1" Height="320" HorizontalAlignment="Left" Margin="4,6,4,0" Name="stackPanel1" VerticalAlignment="Top" Width="491">
<StackPanel Height="40" Name="stackPanel4" Orientation="Horizontal" Width="440">
<Button Content="Update User Data" Name="button1" Height="23" Width="440" Command="{Binding Path=UpdateDataCommand}"/>
</StackPanel>
<StackPanel Height="31" Name="stackPanel3" Orientation="Horizontal" Width="440">
<sdk:Label Content="Username" Height="28" Name="label2" Width="74" />
<TextBox Height="23" Name="textBox2" Width="365" Text="{Binding Username, Mode=OneWay}" />
</StackPanel>
</StackPanel>