'System.Windows.Controls.Panel.Children' is set more than once. [Line: 339 Position: 18]

12 posts, 0 answers
  1. Eric
    Eric avatar
    8 posts
    Member since:
    Feb 2009

    Posted 20 Apr 2010 Link to this post

    I resolved this by upgrading to the SL4 controls 

  2. Chris
    Chris avatar
    53 posts
    Member since:
    Oct 2012

    Posted 21 Apr 2010 Link to this post

    I too saw this issue when using the Silverlight 3 controls. Upgrading to the SIlverlight 4 controls resulted in a different error for me:

    Failed to create a 'System.Windows.DependencyProperty' from the text 'animation:AnimationManager.AnimationSelector'. [Line: 6 Position: 34]

    So far I am only referencing Telerik.Windows.Controls and Telerik.Windows.Controls.Input. Is there another Silverlight 4 reference I need to add?

    Thanks
  3. DevCraft banner
  4. Eric
    Eric avatar
    8 posts
    Member since:
    Feb 2009

    Posted 21 Apr 2010 Link to this post

    On this site I went to "your account" "downloads" "latest internal builds"

    Get the SL4 zip file, unzip it to a new folder (I created one in program files\telerik)

    In your project - delete the current references you have
    add in new references for the same DLLs but from the above (new) folder

    Save, exit vs2010, restart and run
    My project is using 5 dlls (input, navigation, data, charting, controls) and I did not have to add anything else/new

    On the silverlight tab of your client side project make sure the targer silverlight version is 4
  5. Chris
    Chris avatar
    53 posts
    Member since:
    Oct 2012

    Posted 21 Apr 2010 Link to this post

    Hi,
    I followed your instructions and still see the same error. It occurs right on the InitializeComponent(). I should probably have mentioned that I am still on the Release Candidate of Visual Studio 2010.
  6. Eric
    Eric avatar
    8 posts
    Member since:
    Feb 2009

    Posted 21 Apr 2010 Link to this post

    I've installed the released version of 2010, toolkit etc.  takes hours but might be worth it.  Apart from that you probably need help from Telerik proper.
  7. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 26 Apr 2010 Link to this post

    Hello Eric, Chris,

    Silverlight 4 XAML parser is more "strict" than the Silverlight 3's parser and it throws exceptions for code that worked well in Silverlight 3. That's why you should use our Silverlight 4 assemblies in Silverlight 4 applications.

    All the best,
    Valeri Hristov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  8. Simon Wolters
    Simon Wolters avatar
    20 posts
    Member since:
    Mar 2010

    Posted 27 Apr 2010 Link to this post

    I also get the exception after upgrading my projects from SL3 to SL4 and replacing all the assemblies and references with the v422 telerik release:
    Failed to create a 'System.Windows.DependencyProperty' from the text 'animation:AnimationManager.AnimationSelector'.

    The inner exception says:
    {System.TypeInitializationException: Der Typeninitialisierer für "Telerik.Windows.Controls.Animation.AnimationManager" hat eine Ausnahme verursacht. ---> System.TypeLoadException: Der Typ 'System.Action' konnte nicht aus der mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e -Assembly geladen werden.
       bei Telerik.Windows.Controls.Animation.AnimationManager..cctor()
       --- Ende der internen Ausnahmestapelüberwachung ---
       bei System.Runtime.CompilerServices.RuntimeHelpers._RunClassConstructor(RuntimeType type)
       bei System.Windows.DependencyProperty.QueryRegisteredProperty(String name, Type ownerType)
       bei MS.Internal.ManagedTypeInfoProviderRPInvokes.LookupDependencyProperty(Type type, String name)
       bei MS.Internal.ManagedTypeInfoProviderRPInvokes.ResolveDependencyPropertyName(XamlTypeToken sTypeToken, String inPropertyName, XamlPropertyToken& outProperty, XamlTypeToken& outPropertyTypeToken)}






    I removed all the mentioned extension properties for animations from my controls but still get the error. I guess the problem is that your themes are using these properties as well.
  9. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 27 Apr 2010 Link to this post

    Hi Simon,

    I already answered the following thread:
    http://www.telerik.com/community/forums/silverlight/combobox/error-using-silverlight-4-controls.aspx

    The exception should disappear if you update the Silverlight runtime to version 4.0.50401.

    Kind regards,
    Valeri Hristov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  10. Simon Wolters
    Simon Wolters avatar
    20 posts
    Member since:
    Mar 2010

    Posted 28 Apr 2010 Link to this post

    Hi Valeri,

    thank you - indeed the exception is gone after the SL runtime upgrade.
    Now I unfortunately get the same exception as mentioned by the thread creator:
    'System.Windows.Controls.Panel.Children' is set more than once.

    I am using a custom theme that is based on the telerik v3.09 windows 7 theme. If I disable this theme and use your default theme, the solution works fine. Do you know which propertie(s) are causing this error in SL4? I'd rather fix those than reapply my custom theming to the new version.
  11. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 29 Apr 2010 Link to this post

    Hello Simon,

    The "'System.Windows.Controls.Panel.Children' is set more than once" exception is caused by invalid XAML: in Silverlight 4 setting attached properties inside the content of an element is considered an error, hence the exception. For example the following XAML is wrong:
    <Grid>
        <Border />
        <VisualStyleManager.VisualStateGroups>
        ...
        </VisualStyleManager.VisualStateGroups>
        <StackPanel />
    </Grid>

    but the following is OK:
    <Grid>
        <VisualStyleManager.VisualStateGroups>
        ...
        </VisualStyleManager.VisualStateGroups>
        <Border />
        <StackPanel />
    </Grid>

    note that to fix the problem, the attached property VisualStateGroups should be the first XML element inside the Grid element. This XAML used to work fine in Silverlight 3 and the early versions of Silverlight 4.

    Sincerely yours,
    Valeri Hristov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  12. Simon Wolters
    Simon Wolters avatar
    20 posts
    Member since:
    Mar 2010

    Posted 29 Apr 2010 Link to this post

    That did the trick!

    Thank you very much. The telerik support is really awesome.
  13. Mike Lee
    Mike Lee avatar
    11 posts
    Member since:
    Jan 2010

    Posted 01 Sep 2010 Link to this post

    Thanks for this solution.  We've been trying to figure this out for weeks, and thought we introduced a bad element into our theme.  Basically, we took the template for the radcombobox and moved the VisualStateManager to the top of the grid, and moved a border to the bottom to get rid of the error.  Thanks!

    This snippet:
    <vsm:VisualStateManager.VisualStateGroups>
        <VisualStateGroup x:Name="CommonStates">
            <VisualState x:Name="Normal" />
            <VisualState x:Name="MouseOver">
                <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonChrome" Storyboard.TargetProperty="RenderHighlighted">
                        <DiscreteObjectKeyFrame KeyTime="0:0:0">
                            <DiscreteObjectKeyFrame.Value>
                                <sys:Boolean>True</sys:Boolean>
                            </DiscreteObjectKeyFrame.Value>
                        </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                </Storyboard>
            </VisualState>
            <VisualState x:Name="Disabled">
                <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity">
                        <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0.33" />
                    </DoubleAnimationUsingKeyFrames>
                </Storyboard>
            </VisualState>
        </VisualStateGroup>
    </vsm:VisualStateManager.VisualStateGroups>
     
    <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" />



    - Mike
    www.eikospartners.com
Back to Top
DevCraft banner