Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
310
Does ig:XamMap control overwrite the exception? Or, Whats wrong with "Element is already the child of another element." exception?
posted

Does XamMap control overwrite the default exception? For example: When we play the storyboard that target to the element that doesn't exist, we used to get the exception like "Cannot resolve TargetName {NAME}".. but after we add the XamlMap control, all exceptions that we are getting is this exception ""Element is already the child of another element."".. Why?

Here is the step to reproduce the issue.

1. Create new Silverlight 4 project in VS 2010 and add the following assemblies.

InfragisticsSL4.v10.3
InfragisticsSL4.DataVisualization.v10.3
InfragisticsSL4.Controls.Maps.XamMap.v10.3

3. Add this storyboard in UserControl.Resources of MainPage.xaml.

  <Storyboard x:Name="showDotImageStoryboard">
            <DoubleAnimationUsingKeyFrames x:Name="opacityKeyFrame" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="dotImageControl">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
</Storyboard>

4. Run the project.
Observe: You will see this exception "Cannot resolve TargetName dotImageControl." which is correct.

5. Add XamlMap control in Grid "LayoutRoot"

6. Run the project again and check the exception

The expected exception : Cannot resolve TargetName dotImageControl.

The actual exception : "Element is already the child of another element."

Feel free to let me know if you need more information.