UserControl "composition" problem

Aug 28, 2011 at 9:47 AM

Hello.

I want my user control (not main page) to contain other user control. But when I do that, then physics word stucks. Little example:

<UserControl
    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:local="clr-namespace:Test"
    mc:Ignorable="d"
    x:Class="Test.ucCompose"
    d:DesignWidth="200" d:DesignHeight="200">

    <Canvas>
        <local:ucInside Height="100" Width="100" Canvas.Left="17"/>
    </Canvas>
</UserControl>
--------------------------------------------------------------------------------------------------------------------
<UserControl 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:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:pb="clr-namespace:Spritehand.PhysicsBehaviors;assembly=Spritehand.PhysicsBehaviors" mc:Ignorable="d" x:Class="Test.ucInside" d:DesignWidth="100" d:DesignHeight="100"> <Canvas> <Ellipse Fill="#FFF4F4F5" Height="33" Canvas.Left="24" Stroke="Black" Canvas.Top="22" Width="33"> <i:Interaction.Behaviors> <pb:PhysicsObjectBehavior/> </i:Interaction.Behaviors> </Ellipse> </Canvas> </UserControl>

When I add ucCompose to MainPage, then ball doesn't fall down, but when I add just ucInside then it does.

Can you help me out with this problem? Am I doing something wrong?