How to add PhysicsMagnetBehavior

May 6, 2013 at 8:28 PM
I'm new to the Helper Library and CANNOT figure out what seems like it should be so simple. How do I apply the Magnet behavior? What am I missing?

Here's what I am working with:
    <Canvas x:Name="LayoutRoot" Background="White">
        <i:Interaction.Behaviors>
            <pb:PhysicsControllerBehavior MousePickEnabled="True"/>
        </i:Interaction.Behaviors>
        <Rectangle x:Name="floor" Fill="Black" Height="90" Canvas.Left="-36" Stroke="Black" Canvas.Top="421" Width="701">
            <i:Interaction.Behaviors>
                <pb:PhysicsObjectBehavior IsStatic="True"/>
            </i:Interaction.Behaviors>
        </Rectangle>
        <Ellipse Fill="#FF898989" Height="54" Canvas.Left="185" Stroke="Black" Canvas.Top="164" Width="54">
            <i:Interaction.Behaviors>
                <pb:PhysicsObjectBehavior RestitutionCoefficient="0.5" Mass="1"/>
            </i:Interaction.Behaviors>
        </Ellipse>
        <Rectangle x:Name="rectangle" Fill="#FF898989" Height="187" Canvas.Left="279" Stroke="Black" Canvas.Top="218" Width="75">
            <i:Interaction.Behaviors>
                <pb:PhysicsMagnetBehavior MaxDistance="500"/>
                <pb:PhysicsObjectBehavior Mass="5"/>
            </i:Interaction.Behaviors>
        </Rectangle>
    </Canvas>